mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-04 03:49:16 +02:00
Resolve "CLI in-place import impossible with virtualenv with python3.5"
This commit is contained in:
parent
96f6b1e192
commit
f54038ca83
4 changed files with 20 additions and 1 deletions
|
@ -27,7 +27,8 @@ def crawl_dir(dir, extensions, recursive=True, ignored=[]):
|
|||
if os.path.isfile(dir):
|
||||
yield dir
|
||||
return
|
||||
with os.scandir(dir) as scanner:
|
||||
try:
|
||||
scanner = os.scandir(dir)
|
||||
for entry in scanner:
|
||||
if entry.is_file():
|
||||
for e in extensions:
|
||||
|
@ -38,6 +39,9 @@ def crawl_dir(dir, extensions, recursive=True, ignored=[]):
|
|||
yield from crawl_dir(
|
||||
entry, extensions, recursive=recursive, ignored=ignored
|
||||
)
|
||||
finally:
|
||||
if hasattr(scanner, "close"):
|
||||
scanner.close()
|
||||
|
||||
|
||||
def batch(iterable, n=1):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue