Skip to content

Commit

Permalink
Fix for inconsistent-return-statements errors from new pylint (2.7)
Browse files Browse the repository at this point in the history
  • Loading branch information
dairiki committed Feb 23, 2021
1 parent f30b628 commit 556b3b2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions lektor/buildfailures.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ def lookup_failure(self, artifact_name):
except IOError as e:
if e.errno != errno.ENOENT:
raise
return None

def clear_failure(self, artifact_name):
"""Clears a stored failure."""
Expand Down
1 change: 1 addition & 0 deletions lektor/databags.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def load_databag(filename):
except (OSError, IOError) as e:
if e.errno != errno.ENOENT:
raise
return None


class Databags:
Expand Down
6 changes: 5 additions & 1 deletion lektor/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ def locate_executable(exe_file, cwd=None, include_bundle_path=True):
return path + ext
return None
except OSError:
pass
return None


class JSONEncoder(json.JSONEncoder):
Expand Down Expand Up @@ -356,6 +356,7 @@ def safe_call(func, args=None, kwargs=None):
except Exception:
# XXX: logging
traceback.print_exc()
return None


class Worker(Thread):
Expand Down Expand Up @@ -600,6 +601,9 @@ def get_relative_path(source, target):
else:
# prepend the distance to the common ancestor
return distance / relpath
# We should never get here. (The last ancestor in source.parents will
# be '.' — target.relative_to('.') will always succeed.)
raise AssertionError("This should not happen")


def get_structure_hash(params):
Expand Down

0 comments on commit 556b3b2

Please sign in to comment.