@@ -153,16 +153,6 @@ internal static void Initialize(bool initSigs = false, ShutdownMode mode = Shutd
153153 ClassDerivedObject . Reset ( ) ;
154154 TypeManager . Initialize ( ) ;
155155
156- // Need to add the runtime directory to sys.path so that we
157- // can find built-in assemblies like System.Data, et. al.
158- string rtdir = RuntimeEnvironment . GetRuntimeDirectory ( ) ;
159- IntPtr path = PySys_GetObject ( "path" ) . DangerousGetAddress ( ) ;
160- IntPtr item = PyString_FromString ( rtdir ) ;
161- if ( PySequence_Contains ( path , item ) == 0 )
162- {
163- PyList_Append ( new BorrowedReference ( path ) , item ) ;
164- }
165- XDecref ( item ) ;
166156 // Initialize modules that depend on the runtime class.
167157 AssemblyManager . Initialize ( ) ;
168158 OperatorMethod . Initialize ( ) ;
@@ -177,6 +167,16 @@ internal static void Initialize(bool initSigs = false, ShutdownMode mode = Shutd
177167 }
178168 Exceptions . Initialize ( ) ;
179169
170+ // Need to add the runtime directory to sys.path so that we
171+ // can find built-in assemblies like System.Data, et. al.
172+ string rtdir = RuntimeEnvironment . GetRuntimeDirectory ( ) ;
173+ IntPtr path = PySys_GetObject ( "path" ) . DangerousGetAddress ( ) ;
174+ IntPtr item = PyString_FromString ( rtdir ) ;
175+ if ( PySequence_Contains ( path , item ) == 0 )
176+ {
177+ PyList_Append ( new BorrowedReference ( path ) , item ) ;
178+ }
179+ XDecref ( item ) ;
180180 AssemblyManager . UpdatePath ( ) ;
181181 }
182182
0 commit comments