Commit 2fc71566 authored by Kirill Smelkov's avatar Kirill Smelkov

golang.pyx: pyselect: Don't accept tuple subclasses; more clear panic on invalid tuple

parent d5e74947
...@@ -490,7 +490,10 @@ def pyselect(*pycasev): ...@@ -490,7 +490,10 @@ def pyselect(*pycasev):
ndefault = n ndefault = n
# send # send
elif isinstance(pycase, tuple): elif type(pycase) is tuple:
if len(pycase) != 2:
pypanic("pyselect: invalid [%d]() case" % len(pycase))
pysend, tx = pycase pysend, tx = pycase
if pysend.__self__.__class__ is not pychan: if pysend.__self__.__class__ is not pychan:
pypanic("pyselect: send on non-chan: %r" % (pysend.__self__.__class__,)) pypanic("pyselect: send on non-chan: %r" % (pysend.__self__.__class__,))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment