summaryrefslogtreecommitdiffstats
path: root/src/engine/SCons/Tool/JavaCommon.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/engine/SCons/Tool/JavaCommon.py')
-rw-r--r--src/engine/SCons/Tool/JavaCommon.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/engine/SCons/Tool/JavaCommon.py b/src/engine/SCons/Tool/JavaCommon.py
index 0d4c95a..853f7f2 100644
--- a/src/engine/SCons/Tool/JavaCommon.py
+++ b/src/engine/SCons/Tool/JavaCommon.py
@@ -358,7 +358,9 @@ if java_parsing:
return self.outer_state
def parse_java_file(fn, version=default_java_version):
- return parse_java(open(fn, 'r').read(), version)
+ with open(fn, 'r') as f:
+ data = f.read()
+ return parse_java(data, version)
def parse_java(contents, version=default_java_version, trace=None):
"""Parse a .java file and return a double of package directory,