summaryrefslogtreecommitdiffstats
path: root/Lib/site.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/site.py')
-rw-r--r--Lib/site.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/Lib/site.py b/Lib/site.py
index 732e1c4..acaeb3e 100644
--- a/Lib/site.py
+++ b/Lib/site.py
@@ -384,9 +384,8 @@ class _Printer(object):
for filename in self.__files:
filename = os.path.join(dir, filename)
try:
- fp = open(filename, "r")
- data = fp.read()
- fp.close()
+ with open(filename, "r") as fp:
+ data = fp.read()
break
except OSError:
pass