mirror of
https://github.com/python/cpython.git
synced 2025-07-29 06:05:00 +00:00
Merged revisions 85497 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r85497 | antoine.pitrou | 2010-10-14 23:15:17 +0200 (jeu., 14 oct. 2010) | 3 lines Explicitly close some files (from issue #10093) ........
This commit is contained in:
parent
51be0f47fa
commit
3d400b7a58
3 changed files with 11 additions and 5 deletions
|
@ -193,9 +193,8 @@ class MimeTypes:
|
|||
list of standard types, else to the list of non-standard
|
||||
types.
|
||||
"""
|
||||
fp = open(filename)
|
||||
self.readfp(fp, strict)
|
||||
fp.close()
|
||||
with open(filename) as fp:
|
||||
self.readfp(fp, strict)
|
||||
|
||||
def readfp(self, fp, strict=True):
|
||||
"""
|
||||
|
@ -302,7 +301,7 @@ def init(files=None):
|
|||
files = knownfiles
|
||||
for file in files:
|
||||
if os.path.isfile(file):
|
||||
db.readfp(open(file))
|
||||
db.read(file)
|
||||
encodings_map = db.encodings_map
|
||||
suffix_map = db.suffix_map
|
||||
types_map = db.types_map[True]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue