Commit db344fd7 authored by Wolfgang Rohdewald's avatar Wolfgang Rohdewald
Browse files

pylint: raise from

parent b0127ebd
......@@ -140,8 +140,8 @@ class Hand(StrMixin):
if len(part) > 1:
try:
self.__lastSource = TileSource.byChar[part[1]]
except KeyError:
raise Exception('{} has unknown lastTile {}'.format(inString, part[1]))
except KeyError as _:
raise Exception('{} has unknown lastTile {}'.format(inString, part[1])) from _
if len(part) > 2:
self.__announcements = set(part[2])
elif partId == 'L':
......
......@@ -134,12 +134,11 @@ class Url(str, StrMixin):
'/modules/networkstatus',
'org.kde.Solid.Networking.status'],
stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate(timeout=1)
except subprocess.TimeoutExpired:
raise twisted.internet.error.ConnectError()
except subprocess.TimeoutExpired as _:
raise twisted.internet.error.ConnectError() from _
stdoutdata = stdoutdata.strip()
stderrdata = stderrdata.strip()
if stderrdata == '' and stdoutdata != '4':
# pylint: disable=nonstandard-exception
raise twisted.internet.error.ConnectError()
# if we have stderrdata, qdbus probably does not provide the
# service we want, so ignore it
......
......@@ -351,9 +351,9 @@ class Player(StrMixin):
else:
try:
self._concealedTiles.remove(tile)
except ValueError:
except ValueError as _:
raise Exception('removeTile(%s): tile not in concealed %s' %
(tile, ''.join(self._concealedTiles)))
(tile, ''.join(self._concealedTiles))) from _
if tile is self.lastTile:
self.lastTile = None
self._hand = None
......
......@@ -85,7 +85,7 @@ class DBCursor(sqlite3.Cursor):
else:
if not failSilent:
logError(msg)
raise QueryException(msg)
raise QueryException(msg) from exc
return
def __str__(self):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment