We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
with open
1 parent b5104f8 commit a7b42eeCopy full SHA for a7b42ee
1 file changed
tools/webidl_binder.py
@@ -749,12 +749,10 @@ class %s : public %s {
749
750
# Write
751
752
-c = open(output_base + '.cpp', 'w')
753
-for x in pre_c: c.write(x)
754
-for x in mid_c: c.write(x)
755
-c.close()
756
-
757
-js = open(output_base + '.js', 'w')
758
-for x in mid_js: js.write(x)
759
-js.close()
+with open(output_base + '.cpp', 'w') as c:
+ for x in pre_c: c.write(x)
+ for x in mid_c: c.write(x)
+
+with open(output_base + '.js', 'w') as js:
+ for x in mid_js: js.write(x)
760
0 commit comments