diff options
| author | schneefux <schneefux+commit@schneefux.xyz> | 2014-09-11 14:58:39 +0200 |
|---|---|---|
| committer | schneefux <schneefux+commit@schneefux.xyz> | 2014-09-11 14:58:39 +0200 |
| commit | 8e721cd3bcade4fb526d2f7a1d8b02f3fba6bdf5 (patch) | |
| tree | 50d5e0e12f3116bd520394776320dbcaf378fe6e | |
| parent | c4b9f6b302c3192bc0bd8b9b35978e8c958a1e83 (diff) | |
| download | jasper-client-8e721cd3bcade4fb526d2f7a1d8b02f3fba6bdf5.tar.gz jasper-client-8e721cd3bcade4fb526d2f7a1d8b02f3fba6bdf5.zip | |
Use `with` statement in client.g2p
| -rw-r--r-- | client/g2p.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/client/g2p.py b/client/g2p.py index 057757e..3225c73 100644 --- a/client/g2p.py +++ b/client/g2p.py @@ -43,9 +43,8 @@ def translateFile(input_filename, output_filename=None): if output_filename: out = '\n'.join(out) - f = open(output_filename, "wb") - f.write(out) - f.close() + with open(output_filename, "wb") as f: + f.write(out) return None |
