Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cython
Commits
67c44be9
Commit
67c44be9
authored
Jul 28, 2022
by
da-woods
Committed by
GitHub
Jul 28, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix error where "import *" tried to overwrite a macro in utility code (GH-4930)
Closes
https://github.com/cython/cython/issues/4927
parent
1f719622
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
2 deletions
+11
-2
Cython/Utility/MemoryView.pyx
Cython/Utility/MemoryView.pyx
+2
-2
Cython/Utility/MemoryView_C.c
Cython/Utility/MemoryView_C.c
+3
-0
tests/memoryview/memslice.pyx
tests/memoryview/memslice.pyx
+6
-0
No files found.
Cython/Utility/MemoryView.pyx
View file @
67c44be9
...
@@ -23,7 +23,7 @@ cdef extern from "<string.h>":
...
@@ -23,7 +23,7 @@ cdef extern from "<string.h>":
void
*
memset
(
void
*
b
,
int
c
,
size_t
len
)
void
*
memset
(
void
*
b
,
int
c
,
size_t
len
)
cdef
extern
from
*
:
cdef
extern
from
*
:
bint
CYTHON_ATOMICS
bint
__PYX_CYTHON_ATOMICS_ENABLED
()
noexcept
int
__Pyx_GetBuffer
(
object
,
Py_buffer
*
,
int
)
except
-
1
int
__Pyx_GetBuffer
(
object
,
Py_buffer
*
,
int
)
except
-
1
void
__Pyx_ReleaseBuffer
(
Py_buffer
*
)
void
__Pyx_ReleaseBuffer
(
Py_buffer
*
)
...
@@ -352,7 +352,7 @@ cdef class memoryview(object):
...
@@ -352,7 +352,7 @@ cdef class memoryview(object):
(
<
__pyx_buffer
*>
&
self
.
view
).
obj
=
Py_None
(
<
__pyx_buffer
*>
&
self
.
view
).
obj
=
Py_None
Py_INCREF
(
Py_None
)
Py_INCREF
(
Py_None
)
if
not
CYTHON_ATOMICS
:
if
not
__PYX_CYTHON_ATOMICS_ENABLED
()
:
global
__pyx_memoryview_thread_locks_used
global
__pyx_memoryview_thread_locks_used
if
__pyx_memoryview_thread_locks_used
<
THREAD_LOCKS_PREALLOCATED
:
if
__pyx_memoryview_thread_locks_used
<
THREAD_LOCKS_PREALLOCATED
:
self
.
lock
=
__pyx_memoryview_thread_locks
[
__pyx_memoryview_thread_locks_used
]
self
.
lock
=
__pyx_memoryview_thread_locks
[
__pyx_memoryview_thread_locks_used
]
...
...
Cython/Utility/MemoryView_C.c
View file @
67c44be9
...
@@ -24,6 +24,9 @@ typedef struct {
...
@@ -24,6 +24,9 @@ typedef struct {
#ifndef CYTHON_ATOMICS
#ifndef CYTHON_ATOMICS
#define CYTHON_ATOMICS 1
#define CYTHON_ATOMICS 1
#endif
#endif
// using CYTHON_ATOMICS as a cdef extern bint in the Cython memoryview code
// interacts badly with "import *". Therefore, define a helper function-like macro
#define __PYX_CYTHON_ATOMICS_ENABLED() CYTHON_ATOMICS
#define __pyx_atomic_int_type int
#define __pyx_atomic_int_type int
...
...
tests/memoryview/memslice.pyx
View file @
67c44be9
...
@@ -21,6 +21,12 @@ if sys.version_info[0] < 3:
...
@@ -21,6 +21,12 @@ if sys.version_info[0] < 3:
else
:
else
:
import
builtins
import
builtins
try
:
from
Cython.Tests.this_module_does_not_exist
import
*
except
ImportError
:
# Fails, but the existence of "import *" interacted badly with some utility code
pass
def
testcase
(
func
):
def
testcase
(
func
):
@
wraps
(
func
)
@
wraps
(
func
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment