Check .isspace() instead of a literal string for speed.

testing/mmn/mktime_takes_localtime_not_gmtime
Isis Lovecruft 2013-06-03 11:17:07 +00:00
parent 776584bd59
commit e00597c3ed
No known key found for this signature in database
GPG Key ID: A3ADB67A2CDB8B35
1 changed files with 3 additions and 3 deletions

View File

@ -515,14 +515,14 @@ def _sanitise(*args):
except (AssertionError, ProtectedOption) as error:
log.warn("_check_option(): %s" % error.message)
else:
safe_option += (flag + " ")
safe_option += (flag + ' ')
if (not _util._py3k and isinstance(value, basestring)) \
or (_util._py3k and isinstance(value, str)):
values = value.split(' ')
for v in values:
try:
assert v is not None
assert v.strip() != ""
assert not v.isspace()
except:
log.debug("Dropping %s %s" % (flag, v))
continue
@ -549,7 +549,7 @@ def _sanitise(*args):
try:
assert v is not None
assert v.strip() != ""
assert not v.isspace()
except:
log.debug("Dropping %s %s" % (flag, v))
continue