diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2011-06-30 21:25:47 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2011-06-30 21:25:47 (GMT) |
commit | bf816223dfe8f1d36a020b4bc02060b8d1ce7d26 (patch) | |
tree | 3651ee82210cb2110b6808a2545471cac321a22f /Lib/test/test_imp.py | |
parent | 61600cb0c357fcdca048cee586865a26417dbd70 (diff) | |
download | cpython-bf816223dfe8f1d36a020b4bc02060b8d1ce7d26.zip cpython-bf816223dfe8f1d36a020b4bc02060b8d1ce7d26.tar.gz cpython-bf816223dfe8f1d36a020b4bc02060b8d1ce7d26.tar.bz2 |
Issue #12451: Add support.create_empty_file()
We don't need to create a temporary buffered binary or text file object just to
create an empty file.
Replace also os.fdopen(handle).close() by os.close(handle).
Diffstat (limited to 'Lib/test/test_imp.py')
-rw-r--r-- | Lib/test/test_imp.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/Lib/test/test_imp.py b/Lib/test/test_imp.py index 83fcf22..3041218 100644 --- a/Lib/test/test_imp.py +++ b/Lib/test/test_imp.py @@ -324,8 +324,7 @@ class PEP3147Tests(unittest.TestCase): shutil.rmtree('pep3147') self.addCleanup(cleanup) # Touch the __init__.py file. - with open('pep3147/__init__.py', 'w'): - pass + support.create_empty_file('pep3147/__init__.py') m = __import__('pep3147') # Ensure we load the pyc file. support.forget('pep3147') |