summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorptmcg <ptmcg@austin.rr.com>2020-04-27 23:56:17 -0500
committerptmcg <ptmcg@austin.rr.com>2020-04-27 23:56:17 -0500
commit871037d94974b5bd7ef1fa644df1f4e33fe0c6b9 (patch)
tree53ce2d842a93b60b5ca3cddd8ad5445bbed0cbc9
parenta43146a5916f62833e397c655609352909fd06d5 (diff)
downloadpyparsing-git-871037d94974b5bd7ef1fa644df1f4e33fe0c6b9.tar.gz
import and exception types cleanup in statemachine examples
-rw-r--r--examples/statemachine/libraryBookDemo.py2
-rw-r--r--examples/statemachine/statemachine.py1
2 files changed, 2 insertions, 1 deletions
diff --git a/examples/statemachine/libraryBookDemo.py b/examples/statemachine/libraryBookDemo.py
index 61bdd6d..6dbdb46 100644
--- a/examples/statemachine/libraryBookDemo.py
+++ b/examples/statemachine/libraryBookDemo.py
@@ -45,7 +45,7 @@ def run_demo():
print(book)
try:
book.checkout()
- except Exception as e: # statemachine.InvalidTransitionException:
+ except librarybookstate.BookState.InvalidTransitionException as e:
print(e)
print("..cannot check out reserved book")
book.release()
diff --git a/examples/statemachine/statemachine.py b/examples/statemachine/statemachine.py
index a5f144e..befa68e 100644
--- a/examples/statemachine/statemachine.py
+++ b/examples/statemachine/statemachine.py
@@ -8,6 +8,7 @@ import sys
import os
import types
import importlib
+import importlib.machinery
from urllib.parse import urlparse