mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Make sure to explicitly close opened files.
This commit is contained in:
@@ -55,10 +55,15 @@ def find_management_module(app_name):
|
||||
except ImportError as e:
|
||||
if os.path.basename(os.getcwd()) != part:
|
||||
raise e
|
||||
finally:
|
||||
if f:
|
||||
f.close()
|
||||
|
||||
while parts:
|
||||
part = parts.pop()
|
||||
f, path, descr = imp.find_module(part, path and [path] or None)
|
||||
if f:
|
||||
f.close()
|
||||
return path
|
||||
|
||||
def load_command_class(app_name, name):
|
||||
|
||||
Reference in New Issue
Block a user