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
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
29bb8d51
Commit
29bb8d51
authored
Sep 22, 2009
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
String literal warning.
parent
48a54961
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
1 deletion
+16
-1
Cython/Compiler/Errors.py
Cython/Compiler/Errors.py
+14
-0
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+2
-1
No files found.
Cython/Compiler/Errors.py
View file @
29bb8d51
...
@@ -145,6 +145,20 @@ def warning(position, message, level=0):
...
@@ -145,6 +145,20 @@ def warning(position, message, level=0):
echo_file
.
write
(
line
)
echo_file
.
write
(
line
)
return
warn
return
warn
_warn_once_seen
=
{}
def
warn_once
(
position
,
message
,
level
=
0
):
if
level
<
LEVEL
or
message
in
_warn_once_seen
:
return
warn
=
CompileWarning
(
position
,
message
)
line
=
"warning: %s
\
n
"
%
warn
if
listing_file
:
listing_file
.
write
(
line
)
if
echo_file
:
echo_file
.
write
(
line
)
_warn_once_seen
[
message
]
=
True
return
warn
# These functions can be used to momentarily suppress errors.
# These functions can be used to momentarily suppress errors.
error_stack
=
[]
error_stack
=
[]
...
...
Cython/Compiler/ExprNodes.py
View file @
29bb8d51
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
import
operator
import
operator
from
Errors
import
error
,
warning
,
InternalError
from
Errors
import
error
,
warning
,
warn_once
,
InternalError
from
Errors
import
hold_errors
,
release_errors
,
held_errors
,
report_error
from
Errors
import
hold_errors
,
release_errors
,
held_errors
,
report_error
from
Cython.Utils
import
UtilityCode
from
Cython.Utils
import
UtilityCode
import
StringEncoding
import
StringEncoding
...
@@ -942,6 +942,7 @@ class StringNode(ConstNode):
...
@@ -942,6 +942,7 @@ class StringNode(ConstNode):
# Arrange for a Python version of the string to be pre-allocated
# Arrange for a Python version of the string to be pre-allocated
# when coercing to a Python type.
# when coercing to a Python type.
if
dst_type
.
is_pyobject
and
not
self
.
type
.
is_pyobject
:
if
dst_type
.
is_pyobject
and
not
self
.
type
.
is_pyobject
:
warn_once
(
self
.
pos
,
"String literals will no longer be Py3 bytes in Cython 0.12."
,
1
)
node
=
self
.
as_py_string_node
(
env
)
node
=
self
.
as_py_string_node
(
env
)
else
:
else
:
node
=
self
node
=
self
...
...
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