Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't import cysignals.alarm on Windows #39010

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/sage/all.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
import os
import operator
import math
import sys

# ############### end setup warnings ###############################

Expand Down Expand Up @@ -157,7 +158,8 @@

from sage.manifolds.all import *

from cysignals.alarm import alarm, cancel_alarm
if sys.platform != 'win32':
from cysignals.alarm import alarm, cancel_alarm

# Lazily import interacts (#15335)
lazy_import('sage.interacts', 'all', 'interacts')
Expand Down
2 changes: 0 additions & 2 deletions src/sage/all__sagemath_objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@

from sage.cpython.all import *

from cysignals.alarm import alarm, cancel_alarm

from copy import copy, deepcopy

true = True
Expand Down
12 changes: 8 additions & 4 deletions src/sage/matrix/benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,17 @@
======================================================================
"""

from .constructor import random_matrix, Matrix
import sys

from sage.matrix.constructor import Matrix, random_matrix
from sage.misc.lazy_import import lazy_import
from sage.misc.timing import cputime
from sage.rings.finite_rings.finite_field_constructor import FiniteField as GF
from sage.rings.integer_ring import ZZ
from sage.rings.rational_field import QQ
from sage.rings.finite_rings.finite_field_constructor import FiniteField as GF
from sage.misc.timing import cputime
from cysignals.alarm import AlarmInterrupt, alarm, cancel_alarm

if sys.platform != 'win32':
from cysignals.alarm import AlarmInterrupt, alarm, cancel_alarm

lazy_import('sage.interfaces.magma', 'magma')

Expand Down
5 changes: 4 additions & 1 deletion src/sage/parallel/use_fork.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@
# ****************************************************************************


import sys
from shutil import rmtree
from cysignals.alarm import AlarmInterrupt, alarm, cancel_alarm

if sys.platform != 'win32':
from cysignals.alarm import AlarmInterrupt, alarm, cancel_alarm

from sage.interfaces.process import ContainChildren
from sage.misc.timing import walltime
Expand Down
12 changes: 8 additions & 4 deletions src/sage/tests/benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,33 @@

sage: import sage.tests.benchmark
"""
from cysignals.alarm import alarm, cancel_alarm, AlarmInterrupt
import sys

if sys.platform != 'win32':
from cysignals.alarm import AlarmInterrupt, alarm, cancel_alarm

from sage.combinat.combinat import fibonacci
from sage.functions.other import factorial
from sage.interfaces.gp import gp
from sage.interfaces.macaulay2 import macaulay2
from sage.interfaces.magma import magma, Magma
from sage.interfaces.magma import Magma, magma
from sage.interfaces.maple import maple
from sage.interfaces.mathematica import mathematica
from sage.interfaces.maxima import maxima
from sage.interfaces.singular import singular
from sage.libs.pari import pari
from sage.libs.gap.libgap import libgap
from sage.libs.pari import pari
from sage.matrix.matrix_space import MatrixSpace
from sage.misc.functional import log
from sage.misc.timing import cputime, walltime
from sage.modular.modsym.modsym import ModularSymbols
from sage.rings.complex_mpfr import ComplexField
from sage.rings.finite_rings.finite_field_constructor import GF
from sage.rings.finite_rings.integer_mod_ring import Integers
from sage.rings.rational_field import QQ
from sage.rings.integer import Integer
from sage.rings.integer_ring import ZZ
from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing
from sage.rings.rational_field import QQ
from sage.schemes.elliptic_curves.constructor import EllipticCurve


Expand Down
Loading