Skip to content

Commit b5f69b0

Browse files
author
Release Manager
committed
gh-37179: `sage.categories.schemes`: Fix modularization regression <!-- ^^^^^ Please provide a concise, informative and self-explanatory title. Don't put issue numbers in there, do this in the PR body below. For example, instead of "Fixes #1234" use "Introduce new method to calculate 1+1" --> <!-- Describe your changes here in detail --> <!-- Why is this change required? What problem does it solve? --> A module-level import is moved back inside methods so that the **sagemath-categories** distribution works again. <!-- If this PR resolves an open issue, please link to it here. For example "Fixes #12345". --> <!-- If your change requires a documentation PR, please link it appropriately. --> ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> <!-- If your change requires a documentation PR, please link it appropriately --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> <!-- Feel free to remove irrelevant items. --> - [x] The title is concise, informative, and self-explanatory. - [x] The description explains in detail what this PR is about. - [ ] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation accordingly. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on - #12345: short description why this is a dependency - #34567: ... --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> URL: #37179 Reported by: Matthias Köppe Reviewer(s): Lorenz Panny
2 parents 1407385 + d2fa576 commit b5f69b0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/sage/categories/schemes.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919
from sage.categories.fields import Fields
2020
from sage.categories.homsets import HomsetsCategory
2121

22-
from sage.schemes.generic.scheme import is_Scheme, is_AffineScheme
23-
2422

2523
class Schemes(Category):
2624
"""
@@ -75,6 +73,7 @@ def __classcall_private__(cls, X=None):
7573
Category of schemes over Integer Ring
7674
"""
7775
if X is not None:
76+
from sage.schemes.generic.scheme import is_Scheme
7877
if not is_Scheme(X):
7978
X = Schemes()(X)
8079
return Schemes_over_base(X)
@@ -137,6 +136,7 @@ def _call_(self, x):
137136
To: Rational Field
138137
139138
"""
139+
from sage.schemes.generic.scheme import is_Scheme
140140
if is_Scheme(x):
141141
return x
142142
from sage.schemes.generic.morphism import is_SchemeMorphism
@@ -229,6 +229,7 @@ def __init__(self, base):
229229
sage: AbelianVarieties(Spec(QQ))
230230
Category of abelian varieties over Rational Field
231231
"""
232+
from sage.schemes.generic.scheme import is_AffineScheme
232233
if is_AffineScheme(base):
233234
base = base.coordinate_ring()
234235
if base not in Fields():

0 commit comments

Comments
 (0)