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
3bd0078f
Commit
3bd0078f
authored
May 14, 2009
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor complex number fixes
parent
5329d55d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
5 deletions
+8
-5
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+6
-3
tests/errors/nogil.pyx
tests/errors/nogil.pyx
+2
-2
No files found.
Cython/Compiler/ExprNodes.py
View file @
3bd0078f
...
...
@@ -1048,8 +1048,8 @@ class ImagNode(AtomicNewTempExprNode):
# when coercing to a Python type.
if
dst_type
.
is_pyobject
:
self
.
is_temp
=
1
self
.
gil_check
(
env
)
self
.
type
=
PyrexTypes
.
py_object_type
self
.
gil_check
(
env
)
# We still need to perform normal coerce_to processing on the
# result, because we might be coercing to an extension type,
# in which case a type test node will be needed.
...
...
@@ -4183,6 +4183,8 @@ class BinopNode(NewTempExprNode):
class
NumBinopNode
(
BinopNode
):
# Binary operation taking numeric arguments.
infix
=
True
def
analyse_c_operation
(
self
,
env
):
type1
=
self
.
operand1
.
type
type2
=
self
.
operand2
.
type
...
...
@@ -4190,7 +4192,8 @@ class NumBinopNode(BinopNode):
if
not
self
.
type
:
self
.
type_error
()
return
self
.
infix
=
not
self
.
type
.
is_complex
or
env
.
directives
[
'c99_complex'
]
if
self
.
type
.
is_complex
and
not
env
.
directives
[
'c99_complex'
]:
self
.
infix
=
False
if
not
self
.
infix
:
self
.
operand1
=
self
.
operand1
.
coerce_to
(
self
.
type
,
env
)
self
.
operand2
=
self
.
operand2
.
coerce_to
(
self
.
type
,
env
)
...
...
@@ -4351,7 +4354,7 @@ class DivNode(NumBinopNode):
code
.
putln
(
'PyErr_Format(PyExc_OverflowError, "value too large to perform division");'
)
code
.
putln
(
code
.
error_goto
(
self
.
pos
))
code
.
putln
(
"}"
)
if
code
.
globalstate
.
directives
[
'cdivision_warnings'
]
and
self
.
opera
nd
!=
'/'
:
if
code
.
globalstate
.
directives
[
'cdivision_warnings'
]
and
self
.
opera
tor
!=
'/'
:
code
.
globalstate
.
use_utility_code
(
cdivision_warning_utility_code
)
code
.
putln
(
"if ((%s < 0) ^ (%s < 0)) {"
%
(
self
.
operand1
.
result
(),
...
...
tests/errors/nogil.pyx
View file @
3bd0078f
...
...
@@ -25,7 +25,7 @@ cdef object m():
i
=
42
obj
=
None
17L
7j
<
object
>
7j
help
`"Hello"`
import
fred
...
...
@@ -85,7 +85,7 @@ _ERRORS = u"""
15: 5: Calling gil-requiring function without gil
24: 9: Calling gil-requiring function without gil
26:12: Assignment of Python object not allowed without gil
28:
8
: Constructing complex number not allowed without gil
28:
16
: Constructing complex number not allowed without gil
29:12: Accessing Python global or builtin not allowed without gil
30: 8: Backquote expression not allowed without gil
31:15: Python import not allowed without gil
...
...
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