Try to be a bit more future compatible with Python 3
git-svn-id: svn://svn.code.sf.net/p/crossfire/code/maps/trunk@11329 282e977c-c81d-0410-88c4-b93c2d0d6712master
parent
99bbaf77a8
commit
364f9f2d3c
|
@ -58,7 +58,7 @@ class CFDataFile:
|
|||
try:
|
||||
file = open(self.filename,'rb')
|
||||
except:
|
||||
raise 'Unable to read %s' % self.filename
|
||||
raise Exception('Unable to read %s' % self.filename)
|
||||
else:
|
||||
temp = file.read().split('\n')
|
||||
file.close()
|
||||
|
@ -75,7 +75,7 @@ class CFDataFile:
|
|||
try:
|
||||
file = open(self.filename,'wb')
|
||||
except:
|
||||
raise 'Unable to open %s for writing' % self.datafile_name
|
||||
raise Exception('Unable to open %s for writing' % self.datafile_name)
|
||||
else:
|
||||
header = dic['#']
|
||||
del dic['#']
|
||||
|
@ -107,7 +107,7 @@ class CFData:
|
|||
# see if header in calling object matches header in file
|
||||
# raise an alert but do nothing yet -
|
||||
# indicates possible upgrade of caller, will flesh this out later
|
||||
raise 'Header does not match! You may need to fix the object or the datafile.'
|
||||
raise Exception('Header does not match! You may need to fix the object or the datafile.')
|
||||
else:
|
||||
self.datafile.make_file(self.header)
|
||||
self.datadb = self.datafile.getData()
|
||||
|
|
|
@ -298,7 +298,7 @@ class Dialog:
|
|||
except:
|
||||
Crossfire.Log(Crossfire.LogDebug, "CFDialog: Bad Precondition")
|
||||
return 0
|
||||
if rule.getPrefunction() <> None:
|
||||
if rule.getPrefunction() != None:
|
||||
return rule.getPrefunction()(self.__character, rule)
|
||||
return 1
|
||||
|
||||
|
@ -315,7 +315,7 @@ class Dialog:
|
|||
except:
|
||||
Crossfire.Log(Crossfire.LogDebug, "CFDialog: Bad Postcondition")
|
||||
return 0
|
||||
if rule.getPostfunction() <> None:
|
||||
if rule.getPostfunction() != None:
|
||||
rule.getPostfunction()(self.__character, rule)
|
||||
|
||||
# Search the player file for a particular flag, and if it exists, return
|
||||
|
|
Loading…
Reference in New Issue