mirror of
https://github.com/bndr/pipreqs.git
synced 2025-06-07 12:05:33 +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):
|
def get_all_imports(path):
|
||||||
imports = []
|
imports = []
|
||||||
candidates = []
|
candidates = []
|
||||||
@ -95,7 +97,10 @@ def get_locally_installed_packages():
|
|||||||
if "top_level" in item:
|
if "top_level" in item:
|
||||||
with open(os.path.join(root, item), "r") as f:
|
with open(os.path.join(root, item), "r") as f:
|
||||||
package = root.split("/")[-1].split("-")
|
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:
|
for item in package_import:
|
||||||
if item not in ignore and package[0] not in ignore:
|
if item not in ignore and package[0] not in ignore:
|
||||||
packages[item] = {
|
packages[item] = {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user