OSDN Git Service
(root)
/
joypy
/
Thun.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2cc0ea0
)
Py 3 handles exception propagation a little differently?
author
Simon Forman
<sforman@hushmail.com>
Fri, 24 Dec 2021 03:09:07 +0000
(19:09 -0800)
committer
Simon Forman
<sforman@hushmail.com>
Fri, 24 Dec 2021 03:09:07 +0000
(19:09 -0800)
joy/joy.py
patch
|
blob
|
history
diff --git
a/joy/joy.py
b/joy/joy.py
index
ad597a7
..
3b271b3
100644
(file)
--- a/
joy/joy.py
+++ b/
joy/joy.py
@@
-61,11
+61,10
@@
def joy(stack, expression, dictionary, viewer=None):
term, expression = expression
if isinstance(term, Symbol):
- try:
- term = dictionary[term]
- except KeyError:
+ if term not in dictionary:
raise UnknownSymbolError(term)
- stack, expression, dictionary = term(stack, expression, dictionary)
+ func = dictionary[term]
+ stack, expression, dictionary = func(stack, expression, dictionary)
else:
stack = term, stack