mirror of
https://github.com/python/cpython.git
synced 2025-07-30 06:34:15 +00:00
Replace instances of os.path.walk with os.walk
This commit is contained in:
parent
e3b1940eb9
commit
9ec4aa01f9
2 changed files with 9 additions and 13 deletions
|
@ -211,10 +211,6 @@ def touch(path, text=''):
|
|||
fp.write(text)
|
||||
fp.close()
|
||||
|
||||
def zap(actions, dirname, names):
|
||||
for name in names:
|
||||
actions.append(os.path.join(dirname, name))
|
||||
|
||||
class LongReprTest(unittest.TestCase):
|
||||
def setUp(self):
|
||||
longname = 'areallylongpackageandmodulenametotestreprtruncation'
|
||||
|
@ -233,7 +229,9 @@ class LongReprTest(unittest.TestCase):
|
|||
|
||||
def tearDown(self):
|
||||
actions = []
|
||||
os.path.walk(self.pkgname, zap, actions)
|
||||
for dirpath, dirnames, filenames in os.walk(self.pkgname):
|
||||
for name in dirnames + filenames:
|
||||
actions.append(os.path.join(dirpath, name))
|
||||
actions.append(self.pkgname)
|
||||
actions.sort()
|
||||
actions.reverse()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue