@@ -71,7 +71,7 @@ internal static void Initialize()
71
71
/// </summary>
72
72
internal static void Shutdown ( )
73
73
{
74
- if ( 0 != Runtime . Py_IsInitialized ( ) )
74
+ if ( Runtime . Py_IsInitialized ( ) != 0 )
75
75
{
76
76
Runtime . XDecref ( py_clr_module ) ;
77
77
Runtime . XDecref ( root . pyHandle ) ;
@@ -111,11 +111,11 @@ public static IntPtr GetCLRModule(IntPtr? fromList = null)
111
111
continue ;
112
112
113
113
string s = item . AsManagedObject ( typeof ( string ) ) as string ;
114
- if ( null == s )
114
+ if ( s == null )
115
115
continue ;
116
116
117
117
ManagedType attr = root . GetAttribute ( s , true ) ;
118
- if ( null == attr )
118
+ if ( attr == null )
119
119
continue ;
120
120
121
121
Runtime . XIncref ( attr . pyHandle ) ;
@@ -190,7 +190,7 @@ public static IntPtr __import__(IntPtr self, IntPtr args, IntPtr kw)
190
190
}
191
191
if ( mod_name == "CLR" )
192
192
{
193
- Exceptions . deprecation ( "The CLR module is deprecated. " + " Please use 'clr'.") ;
193
+ Exceptions . deprecation ( "The CLR module is deprecated. Please use 'clr'." ) ;
194
194
IntPtr clr_module = GetCLRModule ( fromList ) ;
195
195
if ( clr_module != IntPtr . Zero )
196
196
{
@@ -305,9 +305,8 @@ public static IntPtr __import__(IntPtr self, IntPtr args, IntPtr kw)
305
305
ModuleObject tail = root ;
306
306
root . InitializePreload ( ) ;
307
307
308
- for ( int i = 0 ; i < names . Length ; i ++ )
308
+ foreach ( string name in names )
309
309
{
310
- string name = names [ i ] ;
311
310
ManagedType mt = tail . GetAttribute ( name , true ) ;
312
311
if ( ! ( mt is ModuleObject ) )
313
312
{
0 commit comments