1
0
forked from VimPlug/jedi

Get rid of a few Python 2 things

This commit is contained in:
Dave Halter
2020-07-02 16:00:26 +02:00
parent ec08506704
commit dac1fb0a06
3 changed files with 6 additions and 8 deletions

View File

@@ -1,6 +1,5 @@
import sys
import os
import re
import inspect
import importlib
import warnings
@@ -102,10 +101,9 @@ def _iter_module_names(inference_state, paths):
name = dir_entry.name
# First Namespaces then modules/stubs
if dir_entry.is_dir():
# pycache is obviously not an interestin namespace. Also the
# pycache is obviously not an interesting namespace. Also the
# name must be a valid identifier.
# TODO use str.isidentifier, once Python 2 is removed
if name != '__pycache__' and not re.search(r'\W|^\d', name):
if name != '__pycache__' and name.isidentifier():
yield name
else:
if name.endswith('.pyi'): # Stub files