mirror of
https://github.com/bndr/pipreqs.git
synced 2025-06-06 03:25:21 +00:00
try to read, ignore if failed
This commit is contained in:
parent
f3ec4d5d2a
commit
b68919c440
@ -28,6 +28,8 @@ REGEXP = [
|
||||
]
|
||||
|
||||
|
||||
|
||||
|
||||
def get_all_imports(path):
|
||||
imports = []
|
||||
candidates = []
|
||||
@ -95,7 +97,10 @@ def get_locally_installed_packages():
|
||||
if "top_level" in item:
|
||||
with open(os.path.join(root, item), "r") as f:
|
||||
package = root.split("/")[-1].split("-")
|
||||
package_import = f.read().strip().split("\n")
|
||||
try:
|
||||
package_import = f.read().strip().split("\n")
|
||||
except:
|
||||
continue
|
||||
for item in package_import:
|
||||
if item not in ignore and package[0] not in ignore:
|
||||
packages[item] = {
|
||||
|
Loading…
x
Reference in New Issue
Block a user