forked from VimPlug/jedi
Start using pathlib.Path instead of all the os.path functions
This commit is contained in:
@@ -12,11 +12,12 @@ def is_stdlib_path(path):
|
||||
# Python standard library paths look like this:
|
||||
# /usr/lib/python3.9/...
|
||||
# TODO The implementation below is probably incorrect and not complete.
|
||||
if 'dist-packages' in path or 'site-packages' in path:
|
||||
parts = path.parts
|
||||
if 'dist-packages' in parts or 'site-packages' in parts:
|
||||
return False
|
||||
|
||||
base_path = os.path.join(sys.prefix, 'lib', 'python')
|
||||
return bool(re.match(re.escape(base_path) + r'\d.\d', path))
|
||||
return bool(re.match(re.escape(base_path) + r'\d.\d', str(path)))
|
||||
|
||||
|
||||
def deep_ast_copy(obj):
|
||||
|
||||
Reference in New Issue
Block a user