diff options
author | Doug O'Riordan <oriordan@mail.be> | 2015-03-05 16:23:20 +0000 |
---|---|---|
committer | Doug O'Riordan <oriordan@mail.be> | 2015-03-05 16:23:20 +0000 |
commit | 77af4ea3fec68297be25cb96990040c81d2c4c4e (patch) | |
tree | 9df17fe3acfbc47f6607a6f294e636a442741dc0 /tftpy/TftpClient.py | |
parent | adb8b1ed1ee9b604e24e0a00f41b7f37604f9bf6 (diff) | |
download | tftpy-77af4ea3fec68297be25cb96990040c81d2c4c4e.tar.gz |
Adding python3 support
Diffstat (limited to 'tftpy/TftpClient.py')
-rw-r--r-- | tftpy/TftpClient.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tftpy/TftpClient.py b/tftpy/TftpClient.py index a935b34..2b6992e 100644 --- a/tftpy/TftpClient.py +++ b/tftpy/TftpClient.py @@ -3,9 +3,9 @@ instance of the client, and then use its upload or download method. Logging is performed via a standard logging object set in TftpShared.""" import types -from TftpShared import * -from TftpPacketTypes import * -from TftpContexts import TftpContextClientDownload, TftpContextClientUpload +from .TftpShared import * +from .TftpPacketTypes import * +from .TftpContexts import TftpContextClientDownload, TftpContextClientUpload class TftpClient(TftpSession): """This class is an implementation of a tftp client. Once instantiated, a @@ -19,11 +19,11 @@ class TftpClient(TftpSession): self.iport = port self.filename = None self.options = options - if self.options.has_key('blksize'): + if 'blksize' in self.options: size = self.options['blksize'] tftpassert(types.IntType == type(size), "blksize must be an int") if size < MIN_BLKSIZE or size > MAX_BLKSIZE: - raise TftpException, "Invalid blksize: %d" % size + raise TftpException("Invalid blksize: %d" % size) def download(self, filename, output, packethook=None, timeout=SOCK_TIMEOUT): """This method initiates a tftp download from the configured remote |