Change _is_file to return booleans and never raise anything.

feature/documentation-builds-dirhtml
Isis Lovecruft 2013-03-16 02:02:54 +00:00 committed by Isis Lovecruft
parent babff61ec2
commit 058c6f6ca8
1 changed files with 5 additions and 4 deletions

View File

@ -554,11 +554,12 @@ def _is_file(input):
:func:`os.path.isfile`. :func:`os.path.isfile`.
""" """
try: try:
assert os.lstat(input).st_size > 0, "not a file" assert os.lstat(input).st_size > 0, "not a file: %s" % input
except AssertionError as ae: except (AssertionError, TypeError) as error:
raise ProtectedOption(ae.message) logger.debug(error.message)
except TypeError:
return False return False
else:
return True
def _has_readwrite(path): def _has_readwrite(path):
""" """