do not use names which conflict with builtin str type

This commit is contained in:
Eli Schwartz 2019-05-26 21:20:20 -04:00
parent 85884e3fdd
commit d0844e8bbe
No known key found for this signature in database
GPG Key ID: CEB167EFB5722BD6
2 changed files with 7 additions and 7 deletions

View File

@ -21,15 +21,15 @@ def _clean(s):
def _detag(tag): def _detag(tag):
str = u"" ans = u""
if tag is None: if tag is None:
return str return ans
for elem in tag: for elem in tag:
if hasattr(elem, "contents"): if hasattr(elem, "contents"):
str += _detag(elem) ans += _detag(elem)
else: else:
str += _clean(elem) ans += _clean(elem)
return str return ans
def _metadata_from_table(soup, searchfor): def _metadata_from_table(soup, searchfor):

View File

@ -124,9 +124,9 @@ def recipe_test(option, opt_str, value, parser):
assert value is None assert value is None
value = [] value = []
def floatable(str): def floatable(s):
try: try:
float(str) float(s)
return True return True
except ValueError: except ValueError:
return False return False