forked from cython/cython
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Follow the lead of `Cython/Includes/cpython/pyport.pxd` to declare `PY_SSIZE_T_MIN` and `PY_SSIZE_T_MAX` as `const`. This prevents Cython from trying to override or assign to this "variable" when doing wildcard imports. Add a test that shows this behavior in one example. Fixes cython#5562
- Loading branch information
Showing
6 changed files
with
32 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#pragma once | ||
|
||
#include <vector> | ||
|
||
std::vector<int> get_vector() | ||
{ | ||
return std::vector<int>(17); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# mode: compile | ||
# tag: cpp | ||
|
||
# Test that using functionality from libcpp.vector does not lead to compile | ||
# errors when wildcard imports are used as well. | ||
|
||
# Import libcpp.vector, which declares PY_SSIZE_T_MAX. | ||
from libcpp.vector cimport vector | ||
|
||
# Import any other module using a wildcard import. | ||
from spam import * | ||
|
||
# Use the imports (details don't matter). | ||
cdef extern from "vector_include.h": | ||
vector[int] get_vector() | ||
|
||
my_vector = get_vector() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters