From 2bfa878a67d14f7ee725bb2cf9136a5d7a7b32c9 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Sun, 5 Jul 2009 18:36:10 +0200 Subject: [PATCH] Py3 fixes --- Cython/Plex/Machines.py | 7 ++++--- Cython/Plex/Transitions.py | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Cython/Plex/Machines.py b/Cython/Plex/Machines.py index ff8a14fb..6d92d9c6 100644 --- a/Cython/Plex/Machines.py +++ b/Cython/Plex/Machines.py @@ -7,7 +7,6 @@ #======================================================================= import sys -from sys import maxint from Transitions import TransitionMap @@ -116,7 +115,9 @@ class Node(object): priority = self.action_priority if action is not None: file.write(" %s [priority %d]\n" % (action, priority)) - + + def __lt__(self, other): + return self.number < other.number class FastMachine(object): """ @@ -167,7 +168,7 @@ class FastMachine(object): def make_initial_state(self, name, state): self.initial_states[name] = state - def add_transitions(self, state, event, new_state): + def add_transitions(self, state, event, new_state, maxint=sys.maxint): if type(event) is tuple: code0, code1 = event if code0 == -maxint: diff --git a/Cython/Plex/Transitions.py b/Cython/Plex/Transitions.py index add3b448..98d5a286 100644 --- a/Cython/Plex/Transitions.py +++ b/Cython/Plex/Transitions.py @@ -110,6 +110,7 @@ class TransitionMap(object): if set: result.append((event, set)) return iter(result) + items = iteritems # ------------------- Private methods -------------------- -- 2.26.2