projects
/
cython.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
dd91609
)
let char*->bytes conversion know that it returns bytes
author
Stefan Behnel
<scoder@users.berlios.de>
Sat, 28 Nov 2009 08:10:25 +0000
(09:10 +0100)
committer
Stefan Behnel
<scoder@users.berlios.de>
Sat, 28 Nov 2009 08:10:25 +0000
(09:10 +0100)
Cython/Compiler/ExprNodes.py
patch
|
blob
|
history
diff --git
a/Cython/Compiler/ExprNodes.py
b/Cython/Compiler/ExprNodes.py
index 709d5a027fd8f8ff9bc3b9fe46871a85fe597e79..21b3bf1cf8b3a3d4983e6342726e4ee3dd2807fe 100644
(file)
--- a/
Cython/Compiler/ExprNodes.py
+++ b/
Cython/Compiler/ExprNodes.py
@@
-5690,11
+5690,15
@@
class CoerceToPyTypeNode(CoercionNode):
type = py_object_type
is_temp = 1
- def __init__(self, arg, env):
+ def __init__(self, arg, env
, type=py_object_type
):
CoercionNode.__init__(self, arg)
if not arg.type.create_to_py_utility_code(env):
error(arg.pos,
"Cannot convert '%s' to Python object" % arg.type)
+ if type is not py_object_type:
+ self.type = py_object_type
+ elif arg.type.is_string:
+ self.type = Builtin.bytes_type
gil_message = "Converting to Python object"