mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Replace stat.ST_xxx usage with os.stat().st_xxx (#116501)
Modernize code to use the new API which avoids the usage of the stat module just to read os.stat() members. * Sort logging.handlers imports. * Rework reopenIfNeeded() code to make it easier to follow. * Replace "not self.stream" with "self.stream is None".
This commit is contained in:
parent
cca30230d9
commit
61831585b6
3 changed files with 41 additions and 28 deletions
|
@ -702,8 +702,7 @@ class TestMaildir(TestMailbox, unittest.TestCase):
|
|||
self.assertEqual(self._box._factory, factory)
|
||||
for subdir in '', 'tmp', 'new', 'cur':
|
||||
path = os.path.join(self._path, subdir)
|
||||
mode = os.stat(path)[stat.ST_MODE]
|
||||
self.assertTrue(stat.S_ISDIR(mode), "Not a directory: '%s'" % path)
|
||||
self.assertTrue(os.path.isdir(path), f"Not a directory: {path!r}")
|
||||
|
||||
def test_list_folders(self):
|
||||
# List folders
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue