From fed8461e4bff9bb90abfd850676b4078a8dcf4cb Mon Sep 17 00:00:00 2001 From: Michael Farrell Date: Tue, 7 Aug 2012 14:10:37 +0930 Subject: [PATCH] Improved version check so it is much cleaner, fix relative import issue with Python 2.5 not working --- tftpy/__init__.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/tftpy/__init__.py b/tftpy/__init__.py index 3060ed6..9149761 100644 --- a/tftpy/__init__.py +++ b/tftpy/__init__.py @@ -11,14 +11,15 @@ directly. The TftpClient and TftpServer classes can be reached through it. import sys # Make sure that this is at least Python 2.3 -verlist = sys.version_info -if not (verlist[0] > 2 or (verlist[0] == 2 and verlist[1] >= 3)): +required_version = (2, 3) +if sys.version_info < required_version: raise AssertionError, "Requires at least Python 2.3" -from TftpShared import * -from TftpPacketTypes import * -from TftpPacketFactory import * -from TftpClient import * -from TftpServer import * -from TftpContexts import * -from TftpStates import * +from tftpy.TftpShared import * +from tftpy.TftpPacketTypes import * +from tftpy.TftpPacketFactory import * +from tftpy.TftpClient import * +from tftpy.TftpServer import * +from tftpy.TftpContexts import * +from tftpy.TftpStates import * +