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
779e488c
Commit
779e488c
authored
Sep 25, 2007
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix traceback on conditional expression error
parent
257cbde4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
11 deletions
+10
-11
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+10
-11
No files found.
Cython/Compiler/ExprNodes.py
View file @
779e488c
...
@@ -2766,15 +2766,14 @@ class CondExprNode(ExprNode):
...
@@ -2766,15 +2766,14 @@ class CondExprNode(ExprNode):
self
.
true_val
.
analyse_types
(
env
)
self
.
true_val
.
analyse_types
(
env
)
self
.
false_val
.
analyse_types
(
env
)
self
.
false_val
.
analyse_types
(
env
)
self
.
type
=
self
.
compute_result_type
(
self
.
true_val
.
type
,
self
.
false_val
.
type
)
self
.
type
=
self
.
compute_result_type
(
self
.
true_val
.
type
,
self
.
false_val
.
type
)
if
self
.
type
:
if
self
.
true_val
.
type
.
is_pyobject
or
self
.
false_val
.
type
.
is_pyobject
:
if
self
.
true_val
.
type
.
is_pyobject
or
self
.
false_val
.
type
.
is_pyobject
:
self
.
true_val
=
self
.
true_val
.
coerce_to
(
self
.
type
,
env
)
self
.
true_val
=
self
.
true_val
.
coerce_to
(
self
.
type
,
env
)
self
.
false_val
=
self
.
false_val
.
coerce_to
(
self
.
type
,
env
)
self
.
false_val
=
self
.
false_val
.
coerce_to
(
self
.
type
,
env
)
# must be tmp variables so they can share a result
# must be tmp variables so they can share a result
self
.
true_val
=
self
.
true_val
.
coerce_to_temp
(
env
)
self
.
true_val
=
self
.
true_val
.
coerce_to_temp
(
env
)
self
.
false_val
=
self
.
false_val
.
coerce_to_temp
(
env
)
self
.
false_val
=
self
.
false_val
.
coerce_to_temp
(
env
)
self
.
is_temp
=
1
self
.
is_temp
=
1
if
self
.
type
==
PyrexTypes
.
error_type
:
else
:
self
.
type_error
()
self
.
type_error
()
def
allocate_temps
(
self
,
env
,
result_code
=
None
):
def
allocate_temps
(
self
,
env
,
result_code
=
None
):
...
@@ -2813,14 +2812,14 @@ class CondExprNode(ExprNode):
...
@@ -2813,14 +2812,14 @@ class CondExprNode(ExprNode):
elif
type2
.
assignable_from
(
type1
):
elif
type2
.
assignable_from
(
type1
):
return
type2
return
type2
else
:
else
:
return
Non
e
return
PyrexTypes
.
error_typ
e
def
type_error
(
self
):
def
type_error
(
self
):
if
not
(
self
.
true_val
.
type
.
is_error
or
self
.
false_val
.
type
.
is_error
):
if
not
(
self
.
true_val
.
type
.
is_error
or
self
.
false_val
.
type
.
is_error
):
error
(
self
.
pos
,
"Incompatable types in conditional expression (%s; %s)"
%
error
(
self
.
pos
,
"Incompatable types in conditional expression (%s; %s)"
%
(
self
.
true_val
.
type
,
self
.
false_val
.
type
))
(
self
.
true_val
.
type
,
self
.
false_val
.
type
))
self
.
type
=
PyrexTypes
.
error_type
self
.
type
=
PyrexTypes
.
error_type
def
check_const
(
self
):
def
check_const
(
self
):
self
.
test
.
check_const
()
self
.
test
.
check_const
()
self
.
true_val
.
check_const
()
self
.
true_val
.
check_const
()
...
...
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