File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ def set_runtime(runtime):
1616
1717
1818def set_default_runtime () -> None :
19- if sys .platform == ' win32' :
19+ if sys .platform == " win32" :
2020 set_runtime (clr_loader .get_netfx ())
2121 else :
2222 set_runtime (clr_loader .get_mono ())
@@ -36,22 +36,23 @@ def load():
3636 set_default_runtime ()
3737
3838 dll_path = join (dirname (__file__ ), "runtime" , "Python.Runtime.dll" )
39-
39+
4040 _LOADER_ASSEMBLY = _RUNTIME .get_assembly (dll_path )
4141
4242 func = _LOADER_ASSEMBLY ["Python.Runtime.Loader.Initialize" ]
43- if func ('' . encode ( "utf8" ) ) != 0 :
43+ if func (b"" ) != 0 :
4444 raise RuntimeError ("Failed to initialize Python.Runtime.dll" )
4545
4646 import atexit
47+
4748 atexit .register (unload )
4849
4950
5051def unload ():
5152 global _RUNTIME
5253 if _LOADER_ASSEMBLY is not None :
5354 func = _LOADER_ASSEMBLY ["Python.Runtime.Loader.Shutdown" ]
54- if func (b"" ) != 0 :
55+ if func (b"full_shutdown " ) != 0 :
5556 raise RuntimeError ("Failed to call Python.NET shutdown" )
5657
5758 if _RUNTIME is not None :
You can’t perform that action at this time.
0 commit comments