diff options
author | strank <strank@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2008-07-28 08:37:32 +0000 |
---|---|---|
committer | strank <strank@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2008-07-28 08:37:32 +0000 |
commit | cbba13aa0dcc5c11c64cdb287483a6d66e328d4b (patch) | |
tree | b54447e31d0f3717bc5bd14583717fd762c58022 /docutils/statemachine.py | |
parent | 9878aff2fb3421f1a31681d361cc24d1ef3e1a5b (diff) | |
download | docutils-cbba13aa0dcc5c11c64cdb287483a6d66e328d4b.tar.gz |
Merged abolish-userstring-haskey r5609:5616 to trunk.
Backwards compatible changes for easier transition to py3.0.
git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@5618 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
Diffstat (limited to 'docutils/statemachine.py')
-rw-r--r-- | docutils/statemachine.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/docutils/statemachine.py b/docutils/statemachine.py index 514e5dbd1..c29f128a7 100644 --- a/docutils/statemachine.py +++ b/docutils/statemachine.py @@ -377,7 +377,7 @@ class StateMachine: self.next_line(len(block) - 1) return block except UnexpectedIndentationError, error: - block, source, lineno = error + block, source, lineno = error.args self.next_line(len(block) - 1) # advance to last line of block raise @@ -441,7 +441,7 @@ class StateMachine: added. """ statename = state_class.__name__ - if self.states.has_key(statename): + if statename in self.states: raise DuplicateStateError(statename) self.states[statename] = state_class(self, self.debug) @@ -629,9 +629,9 @@ class State: Exceptions: `DuplicateTransitionError`, `UnknownTransitionError`. """ for name in names: - if self.transitions.has_key(name): + if name in self.transitions: raise DuplicateTransitionError(name) - if not transitions.has_key(name): + if name not in transitions: raise UnknownTransitionError(name) self.transition_order[:0] = names self.transitions.update(transitions) @@ -644,7 +644,7 @@ class State: Exception: `DuplicateTransitionError`. """ - if self.transitions.has_key(name): + if name in self.transitions: raise DuplicateTransitionError(name) self.transition_order[:0] = [name] self.transitions[name] = transition |