aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Tools/unicode/gencjkcodecs.py
diff options
context:
space:
mode:
Diffstat (limited to 'Tools/unicode/gencjkcodecs.py')
-rw-r--r--Tools/unicode/gencjkcodecs.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Tools/unicode/gencjkcodecs.py b/Tools/unicode/gencjkcodecs.py
index ebccfc7f96b..45866bf2f61 100644
--- a/Tools/unicode/gencjkcodecs.py
+++ b/Tools/unicode/gencjkcodecs.py
@@ -61,7 +61,8 @@ def gencodecs(prefix):
encoding=enc.lower(),
owner=loc)
codecpath = os.path.join(prefix, enc + '.py')
- open(codecpath, 'w').write(code)
+ with open(codecpath, 'w') as f:
+ f.write(code)
if __name__ == '__main__':
import sys