Commit 20a7a244 authored by Alex Gaynor's avatar Alex Gaynor Committed by Alex Gaynor
Browse files

Make sure to explicitly close opened files.

parent c7734491
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -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):