Make sure to explicitly close opened files.
This commit is contained in:
parent
c7734491f8
commit
20a7a244d7
|
@ -55,10 +55,15 @@ def find_management_module(app_name):
|
||||||
except ImportError as e:
|
except ImportError as e:
|
||||||
if os.path.basename(os.getcwd()) != part:
|
if os.path.basename(os.getcwd()) != part:
|
||||||
raise e
|
raise e
|
||||||
|
finally:
|
||||||
|
if f:
|
||||||
|
f.close()
|
||||||
|
|
||||||
while parts:
|
while parts:
|
||||||
part = parts.pop()
|
part = parts.pop()
|
||||||
f, path, descr = imp.find_module(part, path and [path] or None)
|
f, path, descr = imp.find_module(part, path and [path] or None)
|
||||||
|
if f:
|
||||||
|
f.close()
|
||||||
return path
|
return path
|
||||||
|
|
||||||
def load_command_class(app_name, name):
|
def load_command_class(app_name, name):
|
||||||
|
|
Loading…
Reference in New Issue