mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-02-18 17:00:24 +00:00
hush somewhat-real problems found by static analysis
These would have caused problems if a certain unlikely code path was taken: mostly error-handling pathways.
This commit is contained in:
parent
da4e7dcfbe
commit
5e62118e14
@ -62,7 +62,7 @@ def check_loop(ast, results):
|
||||
# contains another 'for' loop.
|
||||
childnodes = funcnode.getChildNodes()[len(funcnode.defaults):]
|
||||
for child in childnodes:
|
||||
check_ast(funcnode, results)
|
||||
check_ast(child, results)
|
||||
|
||||
def collect_assigned_and_nested(ast, assigned, nested):
|
||||
"""
|
||||
|
@ -243,7 +243,7 @@ class MagicFolder(service.MultiService):
|
||||
clock = clock or reactor
|
||||
db = magicfolderdb.get_magicfolderdb(dbfile, create_version=(magicfolderdb.SCHEMA_v1, 1))
|
||||
if db is None:
|
||||
return Failure(Exception('ERROR: Unable to load magic folder db.'))
|
||||
raise Exception('ERROR: Unable to load magic folder db.')
|
||||
|
||||
# for tests
|
||||
self._client = client
|
||||
|
@ -32,7 +32,7 @@ class BadResponse(object):
|
||||
self.status = -1
|
||||
self.reason = "Error trying to connect to %s: %s" % (url, err)
|
||||
self.error = err
|
||||
def read(self):
|
||||
def read(self, length=0):
|
||||
return ""
|
||||
|
||||
|
||||
|
@ -36,10 +36,11 @@ class LogMixin(object):
|
||||
def log(self, msg, facility=None, parent=None, *args, **kwargs):
|
||||
if facility is None:
|
||||
facility = self._facility
|
||||
pmsgid = None
|
||||
if parent is None:
|
||||
pmsgid = self._parentmsgid
|
||||
if pmsgid is None:
|
||||
pmsgid = self._grandparentmsgid
|
||||
if pmsgid is None:
|
||||
pmsgid = self._grandparentmsgid
|
||||
msgid = log.msg(msg, facility=facility, parent=pmsgid, *args, **kwargs)
|
||||
if self._parentmsgid is None:
|
||||
self._parentmsgid = msgid
|
||||
|
Loading…
x
Reference in New Issue
Block a user