Skip to content

Commit

Permalink
Merge pull request #46 from remram44/py3-exceptions
Browse files Browse the repository at this point in the history
Fixes exceptions
  • Loading branch information
James Bardin committed Mar 2, 2015
2 parents 80111c9 + c4a49eb commit dea3b9d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scp.py
Expand Up @@ -328,7 +328,7 @@ def _recv_all(self):
try:
command[code](msg[1:])
except KeyError:
raise SCPException(str(msg).strip())
raise SCPException(asunicode(msg[1:]))
# directory times can't be set until we're done writing files
self._set_dirtimes()

Expand Down Expand Up @@ -392,7 +392,7 @@ def _recv_file(self, cmd):

msg = chan.recv(512)
if msg and msg[0:1] != b'\x00':
raise SCPException(msg[1:])
raise SCPException(asunicode(msg[1:]))
except SocketTimeout:
chan.close()
raise SCPException('Error receiving, socket.timeout')
Expand Down

0 comments on commit dea3b9d

Please sign in to comment.