File tree Expand file tree Collapse file tree 2 files changed +30
-0
lines changed
Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change 11from .pari_instance import Pari
22from .handle_error import PariError
33from .gen import Gen
4+ from .custom_block import init_custom_block
5+
6+ init_custom_block ()
Original file line number Diff line number Diff line change 1+ # distutils: libraries = gmp pari
2+
3+ # *****************************************************************************
4+ # Distributed under the terms of the GNU General Public License (GPL)
5+ # as published by the Free Software Foundation; either version 2 of
6+ # the License, or (at your option) any later version.
7+ # http://www.gnu.org/licenses/
8+ # *****************************************************************************
9+
10+ from cysignals.signals cimport add_custom_signals
11+
12+ cdef extern from " pari/pari.h" :
13+ int PARI_SIGINT_block, PARI_SIGINT_pending
14+
15+ cdef int custom_signal_is_blocked():
16+ return PARI_SIGINT_block
17+
18+ cdef void custom_signal_unblock():
19+ PARI_SIGINT_block = 0
20+
21+ cdef void custom_set_pending_signal(int sig):
22+ PARI_SIGINT_pending = sig
23+
24+ def init_custom_block ():
25+ add_custom_signals(& custom_signal_is_blocked,
26+ & custom_signal_unblock,
27+ & custom_set_pending_signal)
You can’t perform that action at this time.
0 commit comments