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):
str = u""
ans = u""
if tag is None:
return str
return ans
for elem in tag:
if hasattr(elem, "contents"):
str += _detag(elem)
ans += _detag(elem)
else:
str += _clean(elem)
return str
ans += _clean(elem)
return ans
def _metadata_from_table(soup, searchfor):

View File

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