mirror of
https://github.com/bndr/pipreqs.git
synced 2025-06-06 03:25:21 +00:00
Merge 721dbcbc08a3ae64bb5e4bb920954e708026fd48 into 96440ac2ff16870610dc6a673a142cf401bb08c1
This commit is contained in:
commit
ac4310665f
@ -1,3 +1,3 @@
|
||||
__author__ = 'Vadim Kravcenko'
|
||||
__email__ = 'vadim.kravcenko@gmail.com'
|
||||
__version__ = '0.4.11'
|
||||
__version__ = '0.4.12'
|
||||
|
@ -111,7 +111,7 @@ def get_all_imports(
|
||||
candidates += [os.path.splitext(fn)[0] for fn in files]
|
||||
for file_name in files:
|
||||
file_name = os.path.join(root, file_name)
|
||||
with open(file_name, "r", encoding=encoding) as f:
|
||||
with open(file_name, "r", encoding=encoding, errors="ignore") as f:
|
||||
contents = f.read()
|
||||
try:
|
||||
tree = ast.parse(contents)
|
||||
@ -202,7 +202,7 @@ def get_locally_installed_packages(encoding=None):
|
||||
for item in files:
|
||||
if "top_level" in item:
|
||||
item = os.path.join(root, item)
|
||||
with open(item, "r", encoding=encoding) as f:
|
||||
with open(item, "r", encoding=encoding, errors="ignore") as f:
|
||||
package = root.split(os.sep)[-1].split("-")
|
||||
try:
|
||||
package_import = f.read().strip().split("\n")
|
||||
|
Loading…
x
Reference in New Issue
Block a user