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
Gwenaël Samain
cython
Commits
405ec484
Commit
405ec484
authored
May 14, 2009
by
Dag Sverre Seljebotn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Attempt to fix disappearence of conversion errors (introduced by b8850487f853)
parent
4ef4ba83
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
4 deletions
+8
-4
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+2
-2
Cython/Compiler/PyrexTypes.py
Cython/Compiler/PyrexTypes.py
+2
-2
tests/errors/e_ass.pyx
tests/errors/e_ass.pyx
+4
-0
No files found.
Cython/Compiler/ExprNodes.py
View file @
405ec484
...
@@ -5177,7 +5177,7 @@ class CoerceToPyTypeNode(CoercionNode):
...
@@ -5177,7 +5177,7 @@ class CoerceToPyTypeNode(CoercionNode):
self
.
type
=
py_object_type
self
.
type
=
py_object_type
self
.
gil_check
(
env
)
self
.
gil_check
(
env
)
self
.
is_temp
=
1
self
.
is_temp
=
1
if
not
arg
.
type
.
to_py_function
or
not
arg
.
type
.
create_to_py_utility_code
(
env
):
if
not
arg
.
type
.
create_to_py_utility_code
(
env
):
error
(
arg
.
pos
,
error
(
arg
.
pos
,
"Cannot convert '%s' to Python object"
%
arg
.
type
)
"Cannot convert '%s' to Python object"
%
arg
.
type
)
...
@@ -5215,7 +5215,7 @@ class CoerceFromPyTypeNode(CoercionNode):
...
@@ -5215,7 +5215,7 @@ class CoerceFromPyTypeNode(CoercionNode):
CoercionNode
.
__init__
(
self
,
arg
)
CoercionNode
.
__init__
(
self
,
arg
)
self
.
type
=
result_type
self
.
type
=
result_type
self
.
is_temp
=
1
self
.
is_temp
=
1
if
not
result_type
.
from_py_function
and
not
result_type
.
create_from_py_utility_code
(
env
):
if
not
result_type
.
create_from_py_utility_code
(
env
):
error
(
arg
.
pos
,
error
(
arg
.
pos
,
"Cannot convert Python object to '%s'"
%
result_type
)
"Cannot convert Python object to '%s'"
%
result_type
)
if
self
.
type
.
is_string
and
self
.
arg
.
is_ephemeral
():
if
self
.
type
.
is_string
and
self
.
arg
.
is_ephemeral
():
...
...
Cython/Compiler/PyrexTypes.py
View file @
405ec484
...
@@ -445,10 +445,10 @@ class CType(PyrexType):
...
@@ -445,10 +445,10 @@ class CType(PyrexType):
exception_check
=
1
exception_check
=
1
def
create_to_py_utility_code
(
self
,
env
):
def
create_to_py_utility_code
(
self
,
env
):
return
Tru
e
return
self
.
to_py_function
is
not
Non
e
def
create_from_py_utility_code
(
self
,
env
):
def
create_from_py_utility_code
(
self
,
env
):
return
Tru
e
return
self
.
from_py_function
is
not
Non
e
def
error_condition
(
self
,
result_code
):
def
error_condition
(
self
,
result_code
):
conds
=
[]
conds
=
[]
...
...
tests/errors/e_ass.pyx
View file @
405ec484
...
@@ -4,7 +4,11 @@ cdef void foo(obj):
...
@@ -4,7 +4,11 @@ cdef void foo(obj):
cdef
int
*
p2
cdef
int
*
p2
i1
=
p1
# error
i1
=
p1
# error
p2
=
obj
# error
p2
=
obj
# error
obj
=
p2
# error
_ERRORS
=
u"""
_ERRORS
=
u"""
5:16: Cannot assign type 'char *' to 'int'
5:16: Cannot assign type 'char *' to 'int'
6:17: Cannot convert Python object to 'int *'
6:17: Cannot convert Python object to 'int *'
8:17: Cannot convert 'int *' to Python object
"""
"""
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