DEF X = 0x1234 raises ValueError in ExprNodes.py
Bug #220108 reported by
Jacques Frechet
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Cython |
Fix Committed
|
Medium
|
Unassigned |
Bug Description
I use Cython 0.9.13.1 to compile source containing a hexadecimal compile-time constant such as this one:
DEF X = 0x1234
The build fails with the following exception:
...
File "/usr/local/
return int(self.value)
ValueError: invalid literal for int() with base 10: '0xffff'
I would naively imagine that this could be fixed quite easily by replacing the relevant line in ExprNodes.py with
return int(self.value, 0)
Hardly seems worth the trouble of attaching a patch, but if you'd like me to do so, just say the word.
Thanks!
To post a comment you must log in.
Yes, that's probably the right way to do it. Thanks!