Replace instances of os.path.walk with os.walk

This commit is contained in:
Benjamin Peterson 2008-05-08 22:09:54 +00:00
parent e3b1940eb9
commit 9ec4aa01f9
2 changed files with 9 additions and 13 deletions

View file

@ -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()