Improved version check so it is much cleaner, fix relative import issue with Python 2.5 not working

master
Michael Farrell 2012-08-07 14:10:37 +09:30
parent e8039dd715
commit fed8461e4b
1 changed files with 10 additions and 9 deletions

View File

@ -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 *