Skip to content
Myr

Ensure that config file is closed immediately

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Daniel Neuhäuser · committed by Daniel Neuhäuser · parent a080171 · Browse files · 1 file+2 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+2 added−1 removed

  • other:+2 added−1 removed

1 file+2 added−1 removed

modified:flask/config.py+2 added-1 removed
123 unmodified lines
124 filename = os.path.join(self.root_path, filename)125 d = imp.new_module('config')126 d.__file__ = filename127 try:128 with open(filename) as config_file:128 exec(compile(open(filename).read(), filename, 'exec'), d.__dict__)129 exec(compile(config_file.read(), filename, 'exec'), d.__dict__)130 except IOError as e:131 if silent and e.errno in (errno.ENOENT, errno.EISDIR):132 return False133 e.strerror = 'Unable to load configuration file (%s)' % e.strerror
35 unmodified lines