From 33b0fc2304bc7fee88b2870d2a23684605ea737e Mon Sep 17 00:00:00 2001 From: Nick Coghlan Date: Fri, 19 Oct 2012 23:59:35 +1000 Subject: [PATCH] No reason to use a generator here --- Lib/test/test_import.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/Lib/test/test_import.py b/Lib/test/test_import.py index f209d1b5b5ae..edd18694b9c0 100644 --- a/Lib/test/test_import.py +++ b/Lib/test/test_import.py @@ -15,16 +15,15 @@ from test.test_support import (unlink, TESTFN, unload, run_unittest, rmtree, from test import symlink_support from test import script_helper -def _iter_files(name): - for f in (name + os.extsep + "py", - name + os.extsep + "pyc", - name + os.extsep + "pyo", - name + os.extsep + "pyw", - name + "$py.class"): - yield f +def _files(name): + return (name + os.extsep + "py", + name + os.extsep + "pyc", + name + os.extsep + "pyo", + name + os.extsep + "pyw", + name + "$py.class") def chmod_files(name): - for f in _iter_files(name): + for f in _files(name): try: os.chmod(f, 0600) except OSError as exc: @@ -32,7 +31,7 @@ def chmod_files(name): raise def remove_files(name): - for f in _iter_files(name): + for f in _files(name): unlink(f) -- 2.47.3