From: "Thomas Sachau" <tommy@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/portage:multilib commit in: pym/portage/tests/lint/
Date: Sun, 6 Feb 2011 13:09:57 +0000 (UTC) [thread overview]
Message-ID: <72aa86e97367849e7dd867d0320bbf0b91c836a6.tommy@gentoo> (raw)
commit: 72aa86e97367849e7dd867d0320bbf0b91c836a6
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Jan 31 22:28:12 2011 +0000
Commit: Thomas Sachau <tommy <AT> gentoo <DOT> org>
CommitDate: Mon Jan 31 22:28:12 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=72aa86e9
ImportModulesTestCase: use iterator, not list
---
pym/portage/tests/lint/test_import_modules.py | 9 +++------
1 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/pym/portage/tests/lint/test_import_modules.py b/pym/portage/tests/lint/test_import_modules.py
index 87bb4bf..8d257c5 100644
--- a/pym/portage/tests/lint/test_import_modules.py
+++ b/pym/portage/tests/lint/test_import_modules.py
@@ -13,7 +13,7 @@ class ImportModulesTestCase(TestCase):
expected_failures = frozenset((
))
- for mod in self._list_modules(PORTAGE_PYM_PATH):
+ for mod in self._iter_modules(PORTAGE_PYM_PATH):
try:
__import__(mod)
except ImportError as e:
@@ -21,8 +21,7 @@ class ImportModulesTestCase(TestCase):
self.assertTrue(False, "failed to import '%s': %s" % (mod, e))
del e
- def _list_modules(self, base_dir):
- all_modules = []
+ def _iter_modules(self, base_dir):
for parent, dirs, files in os.walk(base_dir):
parent = _unicode_decode(parent,
encoding=_encodings['fs'], errors='strict')
@@ -38,6 +37,4 @@ class ImportModulesTestCase(TestCase):
x = parent_mod
else:
x = parent_mod + "." + x
- all_modules.append(x)
-
- return all_modules
+ yield x
next reply other threads:[~2011-02-06 13:16 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-06 13:09 Thomas Sachau [this message]
-- strict thread matches above, loose matches on Subject: below --
2011-02-06 13:09 [gentoo-commits] proj/portage:multilib commit in: pym/portage/tests/lint/ Thomas Sachau
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=72aa86e97367849e7dd867d0320bbf0b91c836a6.tommy@gentoo \
--to=tommy@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox