aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/objc/j2objc_dead_code_pruner.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/objc/j2objc_dead_code_pruner.py')
-rwxr-xr-xtools/objc/j2objc_dead_code_pruner.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/tools/objc/j2objc_dead_code_pruner.py b/tools/objc/j2objc_dead_code_pruner.py
index d2f52a4dba..54b8bedc66 100755
--- a/tools/objc/j2objc_dead_code_pruner.py
+++ b/tools/objc/j2objc_dead_code_pruner.py
@@ -200,11 +200,10 @@ def _PruneFile(file_queue, reachable_files, objc_file_path, file_open=open,
if file_name in reachable_files:
file_shutil.copy(input_file, output_file)
else:
- f = file_open(output_file, 'w')
- # Use a static variable scoped to the source file to supress
- # the "has no symbols" linker warning for empty object files.
- f.write(PRUNED_SRC_CONTENT)
- f.close()
+ with file_open(output_file, 'w') as f:
+ # Use a static variable scoped to the source file to supress
+ # the "has no symbols" linker warning for empty object files.
+ f.write(PRUNED_SRC_CONTENT)
file_queue.task_done()