summaryrefslogtreecommitdiff
path: root/Lib/test/test_repr.py
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2008-05-08 22:09:54 +0000
committerBenjamin Peterson <benjamin@python.org>2008-05-08 22:09:54 +0000
commit9ec4aa01f9e1b5f0d8ed94005ac5b14d6ff94ebc (patch)
tree7e9150ba04727525bc05ba3652cc22de5518775c /Lib/test/test_repr.py
parente3b1940eb9eedb752e23310a2b846cb91a970675 (diff)
downloadcpython-git-9ec4aa01f9e1b5f0d8ed94005ac5b14d6ff94ebc.tar.gz
Replace instances of os.path.walk with os.walk
Diffstat (limited to 'Lib/test/test_repr.py')
-rw-r--r--Lib/test/test_repr.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/Lib/test/test_repr.py b/Lib/test/test_repr.py
index 6284f4095a..1094816ae6 100644
--- a/Lib/test/test_repr.py
+++ b/Lib/test/test_repr.py
@@ -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()