@@ -294,23 +294,6 @@ macro_rules! impl_native_exception (
294294 )
295295) ;
296296
297- #[ cfg( windows) ]
298- macro_rules! impl_windows_native_exception (
299- ( $name: ident, $exc_name: ident, $python_name: expr, $doc: expr, $layout: path) => (
300- #[ cfg( windows) ]
301- #[ doc = $doc]
302- #[ repr( transparent) ]
303- #[ allow( clippy:: upper_case_acronyms, reason = "Python exception names" ) ]
304- pub struct $name( $crate:: PyAny ) ;
305-
306- $crate:: impl_exception_boilerplate!( $name) ;
307- $crate:: pyobject_native_type!( $name, $layout, |_py| unsafe { $crate:: ffi:: $exc_name as * mut $crate:: ffi:: PyTypeObject } , "builtins" , $python_name) ;
308- ) ;
309- ( $name: ident, $exc_name: ident, $python_name: expr, $doc: expr) => (
310- impl_windows_native_exception!( $name, $exc_name, $python_name, $doc, $crate:: ffi:: PyBaseExceptionObject ) ;
311- )
312- ) ;
313-
314297macro_rules! native_doc(
315298 ( $name: literal, $alt: literal) => (
316299 concat!(
@@ -732,21 +715,15 @@ impl_native_exception!(
732715 native_doc!( "TimeoutError" )
733716) ;
734717
735- impl_native_exception ! (
736- PyEnvironmentError ,
737- PyExc_EnvironmentError ,
738- "EnvironmentError" ,
739- native_doc!( "EnvironmentError" )
740- ) ;
741- impl_native_exception ! ( PyIOError , PyExc_IOError , "IOError" , native_doc!( "IOError" ) ) ;
718+ /// Alias of `PyOSError`, corresponding to `EnvironmentError` alias in Python.
719+ pub type PyEnvironmentError = PyOSError ;
720+
721+ /// Alias of `PyOSError`, corresponding to `IOError` alias in Python.
722+ pub type PyIOError = PyOSError ;
742723
743724#[ cfg( windows) ]
744- impl_windows_native_exception ! (
745- PyWindowsError ,
746- PyExc_WindowsError ,
747- "WindowsError" ,
748- native_doc!( "WindowsError" )
749- ) ;
725+ /// Alias of `PyOSError`, corresponding to `WindowsError` alias in Python.
726+ pub type PyWindowsError = PyOSError ;
750727
751728impl PyUnicodeDecodeError {
752729 /// Creates a Python `UnicodeDecodeError`.
0 commit comments