diff options
| author | Victor Stinner <victor.stinner@haypocalc.com> | 2011-05-19 13:51:27 (GMT) |
|---|---|---|
| committer | Victor Stinner <victor.stinner@haypocalc.com> | 2011-05-19 13:51:27 (GMT) |
| commit | 21a9c748aa8698c8201e30a58320d587f6bb7540 (patch) | |
| tree | ddfcb60a800bc010237ee750a449c4639e5515e3 /Lib/packaging/tests/support.py | |
| parent | 0e3f3a70760f5ef1c0d1f7baf55046514b6bfbb6 (diff) | |
| download | cpython-21a9c748aa8698c8201e30a58320d587f6bb7540.zip cpython-21a9c748aa8698c8201e30a58320d587f6bb7540.tar.gz cpython-21a9c748aa8698c8201e30a58320d587f6bb7540.tar.bz2 | |
packaging: use with open() instead of try/finally: close
Diffstat (limited to 'Lib/packaging/tests/support.py')
| -rw-r--r-- | Lib/packaging/tests/support.py | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/Lib/packaging/tests/support.py b/Lib/packaging/tests/support.py index cf5d788..dbd8683 100644 --- a/Lib/packaging/tests/support.py +++ b/Lib/packaging/tests/support.py @@ -146,11 +146,8 @@ class TempdirManager: """ if isinstance(path, (list, tuple)): path = os.path.join(*path) - f = open(path, 'w') - try: + with open(path, 'w') as f: f.write(content) - finally: - f.close() def create_dist(self, **kw): """Create a stub distribution object and files. |
