diff options
Diffstat (limited to 'Lib/mailcap.py')
-rw-r--r-- | Lib/mailcap.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/mailcap.py b/Lib/mailcap.py index 99f4958..0c0b19c 100644 --- a/Lib/mailcap.py +++ b/Lib/mailcap.py @@ -22,8 +22,8 @@ def getcaps(): fp = open(mailcap, 'r') except IOError: continue - morecaps = readmailcapfile(fp) - fp.close() + with fp: + morecaps = readmailcapfile(fp) for key, value in morecaps.items(): if not key in caps: caps[key] = value |