Commit b5a2f9dc authored by Kirill Smelkov's avatar Kirill Smelkov

golang: tests: pypanicWhenBlocked: Fix thinko in __exit__

The code was assigning nil to local, _not_ global _tblockforever. As a
result _tblockforever was left set with a test hook even after leaving
test context. Fix it.

The bug was there starting from 3b241983 (Port/move channels to
C/C++/Pyx).

Had to change `= nil` to `= NULL` because with nil Cython complains as

        def __exit__(pypanicWhenBlocked t, typ, val, tb):
            global _tblockforever
            _tblockforever = nil
                            ^
    ------------------------------------------------------------

    golang/_golang_test.pyx:86:25: Cannot assign type 'nullptr_t' to 'void (*)(void) nogil'

This is https://github.com/cython/cython/issues/3314.
parent 9b63ec01
...@@ -82,7 +82,8 @@ cdef class pypanicWhenBlocked: ...@@ -82,7 +82,8 @@ cdef class pypanicWhenBlocked:
return t return t
def __exit__(pypanicWhenBlocked t, typ, val, tb): def __exit__(pypanicWhenBlocked t, typ, val, tb):
_tblockforever = nil global _tblockforever
_tblockforever = NULL
cdef void _panicblocked() nogil: cdef void _panicblocked() nogil:
panic("t: blocks forever") panic("t: blocks forever")
......
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