mirror of
https://github.com/bndr/pipreqs.git
synced 2025-06-07 20:15:22 +00:00
Merge pull request #80 from kxrd/fix-issue-74
Exclude concurrent{,.futures} from stdlib if py2
This commit is contained in:
commit
22e80c27c2
@ -43,8 +43,11 @@ REGEXP = [
|
|||||||
|
|
||||||
if sys.version_info[0] > 2:
|
if sys.version_info[0] > 2:
|
||||||
open_func = open
|
open_func = open
|
||||||
|
py2 = False
|
||||||
else:
|
else:
|
||||||
open_func = codecs.open
|
open_func = codecs.open
|
||||||
|
py2 = True
|
||||||
|
py2_exclude = ["concurrent", "concurrent.futures"]
|
||||||
|
|
||||||
|
|
||||||
def get_all_imports(path, encoding=None, extra_ignore_dirs=None):
|
def get_all_imports(path, encoding=None, extra_ignore_dirs=None):
|
||||||
@ -102,6 +105,7 @@ def get_all_imports(path, encoding=None, extra_ignore_dirs=None):
|
|||||||
|
|
||||||
with open(join("stdlib"), "r") as f:
|
with open(join("stdlib"), "r") as f:
|
||||||
data = [x.strip() for x in f.readlines()]
|
data = [x.strip() for x in f.readlines()]
|
||||||
|
data = [x for x in data if x not in py2_exclude] if py2 else data
|
||||||
return sorted(list(set(packages) - set(data)))
|
return sorted(list(set(packages) - set(data)))
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user