mirror of
https://github.com/bndr/pipreqs.git
synced 2025-06-06 03:25:21 +00:00
Exclude concurrent{,.futures} from stdlib if py2
This commit is contained in:
parent
bddbfc70af
commit
0b0f54a3de
@ -41,8 +41,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):
|
||||||
@ -100,6 +103,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