Skip to content

Commit 487a02f

Browse files
committed
sagemath-standard: don't require Cython to create sdist
The implementation of sage.misc.package_dir.read_distributions uses the function `Cython.Utils.open_source_file()` to open a file instead of `io.open()`. This function was introduced in #29701 (b582789). The only difference between `open_source_file()` and `io.open()` is that the former will open the file as binary to check the encoding. But all our files should be utf-8 so we don't need this trick.
1 parent 0c390a0 commit 487a02f

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/sage/misc/package_dir.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,7 @@ def read_distribution(src_file):
118118
sage: read_distribution(os.path.join(SAGE_SRC, 'sage', 'graphs', 'graph_decompositions', 'modular_decomposition.py'))
119119
''
120120
"""
121-
from Cython.Utils import open_source_file
122-
with open_source_file(src_file, error_handling='ignore') as fh:
121+
with open(src_file, encoding='utf-8', errors='ignore') as fh:
123122
for line in fh:
124123
# Adapted from Cython's Build/Dependencies.py
125124
line = line.lstrip()

0 commit comments

Comments
 (0)