examples: avoid unreachable code in "gmaincontext.py"
lgtm.com warns about this. Avoid it.
This commit is contained in:
@@ -259,7 +259,6 @@ def create_nmc(dbus_connection):
|
|||||||
# This actually should not happen. There is no other reason why
|
# This actually should not happen. There is no other reason why
|
||||||
# initialization can fail.
|
# initialization can fail.
|
||||||
assert False, "NMClient initialization is not supposed to fail"
|
assert False, "NMClient initialization is not supposed to fail"
|
||||||
return nmc
|
|
||||||
|
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
@@ -296,12 +295,11 @@ def make_call(nmc):
|
|||||||
else:
|
else:
|
||||||
log(f"[make_call]: dbus_call() completed with error: {e}")
|
log(f"[make_call]: dbus_call() completed with error: {e}")
|
||||||
|
|
||||||
if False:
|
# I don't understand why, but if you hit this exception (e.g. by setting a low
|
||||||
# I don't understand why, but if you hit this exception (e.g. by setting a low
|
# timeout) and pass the exception to the out context, then an additional reference
|
||||||
# timeout) and pass the exception to the out context, then an additional reference
|
# to nmc is leaked, and destroy_nmc() will fail. Workaround
|
||||||
# to nmc is leaked, and destroy_nmc() will fail. Workaround
|
#
|
||||||
r.error = e
|
#r.error = e
|
||||||
|
|
||||||
r.error = str(e)
|
r.error = str(e)
|
||||||
else:
|
else:
|
||||||
log(
|
log(
|
||||||
|
Reference in New Issue
Block a user