git://git.onelab.eu
/
plcapi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
af097c9
)
python3 does not leak variable name outside an except as
author
parmentelat
<thierry.parmentelat@inria.fr>
Fri, 14 Dec 2018 13:41:25 +0000
(14:41 +0100)
committer
parmentelat
<thierry.parmentelat@inria.fr>
Fri, 14 Dec 2018 13:41:25 +0000
(14:41 +0100)
PLC/Method.py
patch
|
blob
|
history
diff --git
a/PLC/Method.py
b/PLC/Method.py
index
f01271d
..
53d1530
100644
(file)
--- a/
PLC/Method.py
+++ b/
PLC/Method.py
@@
-298,14
+298,16
@@
class Method:
"""
# If any of a number of types is acceptable
"""
# If any of a number of types is acceptable
- if isinstance(expected, Mixed):
+ # try them one by one, if one succeeds then it's fine
+ if expected and isinstance(expected, Mixed):
+ to_raise = None
for item in expected:
try:
self.type_check(name, value, item, args)
return
except PLCInvalidArgument as fault:
for item in expected:
try:
self.type_check(name, value, item, args)
return
except PLCInvalidArgument as fault:
- pass
- raise
fault
+ to_raise = fault
+ raise
to_raise
# If an authentication structure is expected, save it and
# authenticate after basic type checking is done.
# If an authentication structure is expected, save it and
# authenticate after basic type checking is done.