modernize some modules' code by using with statement around open()
diff --git a/Lib/pkgutil.py b/Lib/pkgutil.py
index 0f783de..8fa8405 100644
--- a/Lib/pkgutil.py
+++ b/Lib/pkgutil.py
@@ -349,9 +349,8 @@
                     self.file.close()
             elif mod_type==imp.PY_COMPILED:
                 if os.path.exists(self.filename[:-1]):
-                    f = open(self.filename[:-1], 'r')
-                    self.source = f.read()
-                    f.close()
+                    with open(self.filename[:-1], 'r') as f:
+                        self.source = f.read()
             elif mod_type==imp.PKG_DIRECTORY:
                 self.source = self._get_delegate().get_source()
         return self.source
@@ -591,12 +590,12 @@
                 sys.stderr.write("Can't open %s: %s\n" %
                                  (pkgfile, msg))
             else:
-                for line in f:
-                    line = line.rstrip('\n')
-                    if not line or line.startswith('#'):
-                        continue
-                    path.append(line) # Don't check for existence!
-                f.close()
+                with f:
+                    for line in f:
+                        line = line.rstrip('\n')
+                        if not line or line.startswith('#'):
+                            continue
+                        path.append(line) # Don't check for existence!
 
     return path