Commit 96d3bacb authored by Stefan Behnel's avatar Stefan Behnel

avoid using builtin names as local variables

parent 7e89fa7a
...@@ -93,14 +93,16 @@ def extended_iglob(pattern): ...@@ -93,14 +93,16 @@ def extended_iglob(pattern):
for path in iglob(pattern): for path in iglob(pattern):
yield path yield path
def nonempty(iter, error_msg="expected non-empty iterator"):
any = False def nonempty(it, error_msg="expected non-empty iterator"):
for file in iter: empty = True
any = True for value in it:
yield file empty = False
if not any: yield value
if empty:
raise ValueError(error_msg) raise ValueError(error_msg)
@cached_function @cached_function
def file_hash(filename): def file_hash(filename):
path = os.path.normpath(filename.encode("UTF-8")) path = os.path.normpath(filename.encode("UTF-8"))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment