mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Utilize Python context managers for opening/closing files
In some of these cases, files were not being closed
This commit is contained in:
parent
7c45ff8e05
commit
2ab43bea5d
5 changed files with 18 additions and 21 deletions
|
@ -39,9 +39,8 @@ def main():
|
|||
webIDLFile = os.path.normpath(args[2])
|
||||
|
||||
# Load the parsing results
|
||||
f = open('ParserResults.pkl', 'rb')
|
||||
parserData = cPickle.load(f)
|
||||
f.close()
|
||||
with open('ParserResults.pkl', 'rb') as f:
|
||||
parserData = cPickle.load(f)
|
||||
|
||||
# Create the configuration data.
|
||||
config = Configuration(configFile, parserData)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue