Commit 40f9fed9 authored by rdubner's avatar rdubner
Browse files

COBCD's AddEmUp() handles Python2 or Python3

parent e8b97eeb
......@@ -728,10 +728,14 @@ def GetAddressOf(variable) :
return retval
def AddEmUp(expression) :
expression = expression or "0"
retval = 0
tokens = expression.split('+')
for token in tokens :
if token.isnumeric() :
if token[0:1] in "0123456789" : # Python2/3 ecumenical
if sys.version[0] == '2' :
## This is Python2
token = token.decode("latin1")
retval += int(token)
return retval
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment