Commit b9d85467 authored by Stefan Behnel's avatar Stefan Behnel

adapt old imports for Py2/Py3

parent 37be5ca5
......@@ -12,7 +12,12 @@ import sys
from .Transitions import TransitionMap
LOWEST_PRIORITY = -sys.maxint
try:
from sys import maxsize as maxint
except ImportError:
from sys import maxint
LOWEST_PRIORITY = -maxint
class Machine(object):
......@@ -172,7 +177,7 @@ class FastMachine(object):
def make_initial_state(self, name, state):
self.initial_states[name] = state
def add_transitions(self, state, event, new_state, maxint=sys.maxint):
def add_transitions(self, state, event, new_state, maxint=maxint):
if type(event) is tuple:
code0, code1 = event
if code0 == -maxint:
......
......@@ -9,7 +9,10 @@
from __future__ import absolute_import
import types
from sys import maxint as maxint
try:
from sys import maxsize as maxint
except ImportError:
from sys import maxint
from . import Errors
......
......@@ -6,7 +6,10 @@
from __future__ import absolute_import
from sys import maxint as maxint
try:
from sys import maxsize as maxint
except ImportError:
from sys import maxint
class TransitionMap(object):
......
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