diff options
author | Guido van Rossum <guido@python.org> | 2006-05-02 20:47:36 +0000 |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2006-05-02 20:47:36 +0000 |
commit | bcf5d4bba83934bee560889d12ac901a38d5eb2b (patch) | |
tree | e9af32512187aeca078d5ae93d005b9bc75f2939 /Lib/test/test_mailbox.py | |
parent | 36b17af872aa0c6ba6ebd909f420f210bc1136ed (diff) | |
download | cpython-bcf5d4bba83934bee560889d12ac901a38d5eb2b.tar.gz |
Hopefully this will fix the spurious failures of test_mailbox.py that I'm
experiencing. (This code and mailbox.py itself are full of calls to file()
that should be calls to open() -- but I'm not fixing those.)
Diffstat (limited to 'Lib/test/test_mailbox.py')
-rw-r--r-- | Lib/test/test_mailbox.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/Lib/test/test_mailbox.py b/Lib/test/test_mailbox.py index 6044071d83..18b966fa68 100644 --- a/Lib/test/test_mailbox.py +++ b/Lib/test/test_mailbox.py @@ -577,14 +577,18 @@ class TestMaildir(TestMailbox): # Remove old files from 'tmp' foo_path = os.path.join(self._path, 'tmp', 'foo') bar_path = os.path.join(self._path, 'tmp', 'bar') - file(foo_path, 'w').close() - file(bar_path, 'w').close() + f = open(foo_path, 'w') + f.write("@") + f.close() + f = open(bar_path, 'w') + f.write("@") + f.close() self._box.clean() self.assert_(os.path.exists(foo_path)) self.assert_(os.path.exists(bar_path)) foo_stat = os.stat(foo_path) - os.utime(os.path.join(foo_path), (time.time() - 129600 - 2, - foo_stat.st_mtime)) + os.utime(foo_path, (time.time() - 129600 - 2, + foo_stat.st_mtime)) self._box.clean() self.assert_(not os.path.exists(foo_path)) self.assert_(os.path.exists(bar_path)) |