forked from VimPlug/jedi
Introduce some stricter typing
This commit is contained in:
@@ -33,7 +33,7 @@ import traceback
|
||||
import weakref
|
||||
from functools import partial
|
||||
from threading import Thread
|
||||
from typing import Dict, TYPE_CHECKING
|
||||
from typing import Dict, TYPE_CHECKING, Any
|
||||
|
||||
from jedi._compatibility import pickle_dump, pickle_load
|
||||
from jedi import debug
|
||||
@@ -52,7 +52,7 @@ PICKLE_PROTOCOL = 4
|
||||
|
||||
|
||||
def _GeneralizedPopen(*args, **kwargs):
|
||||
if os.name == 'nt':
|
||||
if sys.platform == "win32":
|
||||
try:
|
||||
# Was introduced in Python 3.7.
|
||||
CREATE_NO_WINDOW = subprocess.CREATE_NO_WINDOW
|
||||
@@ -104,6 +104,8 @@ def _cleanup_process(process, thread):
|
||||
|
||||
|
||||
class _InferenceStateProcess:
|
||||
get_compiled_method_return: Any
|
||||
|
||||
def __init__(self, inference_state: 'InferenceState') -> None:
|
||||
self._inference_state_weakref = weakref.ref(inference_state)
|
||||
self._handles: Dict[int, AccessHandle] = {}
|
||||
|
||||
@@ -592,7 +592,7 @@ def create_from_name(inference_state, compiled_value, name):
|
||||
value = create_cached_compiled_value(
|
||||
inference_state,
|
||||
access_path,
|
||||
parent_context=None if value is None else value.as_context(),
|
||||
parent_context=None if value is None else value.as_context(), # type: ignore # TODO
|
||||
)
|
||||
return value
|
||||
|
||||
@@ -610,7 +610,7 @@ def create_from_access_path(inference_state, access_path):
|
||||
value = create_cached_compiled_value(
|
||||
inference_state,
|
||||
access,
|
||||
parent_context=None if value is None else value.as_context()
|
||||
parent_context=None if value is None else value.as_context() # type: ignore # TODO
|
||||
)
|
||||
return value
|
||||
|
||||
|
||||
Reference in New Issue
Block a user