@@ -16,11 +16,11 @@ def __init__(self, runtime_config: str, dotnet_root: str):
1616 self ._load_func = _get_load_func (self ._dll , self ._handle )
1717
1818 @property
19- def dotnet_root (self ):
19+ def dotnet_root (self ) -> str :
2020 return self ._dotnet_root
2121
2222 @property
23- def is_finalized (self ):
23+ def is_finalized (self ) -> bool :
2424 return self ._is_finalized
2525
2626 def __getitem__ (self , key : str ) -> str :
@@ -58,7 +58,7 @@ def __iter__(self):
5858 for i in range (size_ptr [0 ]):
5959 yield (decode (keys_ptr [i ]), decode (values_ptr [i ]))
6060
61- def get_callable (self , assembly_path , typename , function ):
61+ def get_callable (self , assembly_path : str , typename : str , function : str ):
6262 # TODO: Maybe use coreclr_get_delegate as well, supported with newer API
6363 # versions of hostfxr
6464 self ._is_finalized = True
@@ -79,7 +79,7 @@ def get_callable(self, assembly_path, typename, function):
7979 check_result (res )
8080 return ffi .cast ("component_entry_point_fn" , delegate_ptr [0 ])
8181
82- def shutdown (self ):
82+ def shutdown (self ) -> None :
8383 if self ._handle is not None :
8484 self ._dll .hostfxr_close (self ._handle )
8585 self ._handle = None
@@ -88,7 +88,7 @@ def __del__(self):
8888 self .shutdown ()
8989
9090
91- def _get_handle (dll , dotnet_root , runtime_config ):
91+ def _get_handle (dll , dotnet_root : str , runtime_config : str ):
9292 params = ffi .new ("hostfxr_initialize_parameters*" )
9393 params .size = ffi .sizeof ("hostfxr_initialize_parameters" )
9494 # params.host_path = ffi.new("char_t[]", encode(sys.executable))
0 commit comments