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
Kirill Smelkov
cython
Commits
c88b58ee
Commit
c88b58ee
authored
Mar 28, 2016
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix some pylint findings
parent
3d47a980
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
21 deletions
+18
-21
Cython/Compiler/Code.py
Cython/Compiler/Code.py
+18
-21
No files found.
Cython/Compiler/Code.py
View file @
c88b58ee
...
@@ -40,7 +40,7 @@ try:
...
@@ -40,7 +40,7 @@ try:
except
ImportError
:
except
ImportError
:
from
builtins
import
str
as
basestring
from
builtins
import
str
as
basestring
KEYWORDS_MUST_BE_BYTES
=
sys
.
version_info
<
(
2
,
7
)
KEYWORDS_MUST_BE_BYTES
=
sys
.
version_info
<
(
2
,
7
)
non_portable_builtins_map
=
{
non_portable_builtins_map
=
{
...
@@ -481,7 +481,7 @@ class UtilityCode(UtilityCodeBase):
...
@@ -481,7 +481,7 @@ class UtilityCode(UtilityCodeBase):
is_specialised1, impl = self.inject_string_constants(impl, output)
is_specialised1, impl = self.inject_string_constants(impl, output)
is_specialised2, impl = self.inject_unbound_methods(impl, output)
is_specialised2, impl = self.inject_unbound_methods(impl, output)
writer = output['
utility_code_def
']
writer = output['
utility_code_def
']
writer.putln("/* %s */" % self.name)
;
writer.putln("/* %s */" % self.name)
if not (is_specialised1 or is_specialised2):
if not (is_specialised1 or is_specialised2):
# no module specific adaptations => can be reused
# no module specific adaptations => can be reused
writer.put_or_include(impl, '
%
s_impl
' % self.name)
writer.put_or_include(impl, '
%
s_impl
' % self.name)
...
@@ -849,7 +849,7 @@ class StringConst(object):
...
@@ -849,7 +849,7 @@ class StringConst(object):
def add_py_version(self, version):
def add_py_version(self, version):
if not version:
if not version:
self.py_versions = [2,3]
self.py_versions = [2,
3]
elif version not in self.py_versions:
elif version not in self.py_versions:
self.py_versions.append(version)
self.py_versions.append(version)
...
@@ -1280,8 +1280,8 @@ class GlobalState(object):
...
@@ -1280,8 +1280,8 @@ class GlobalState(object):
self
.
generate_object_constant_decls
()
self
.
generate_object_constant_decls
()
def
generate_object_constant_decls
(
self
):
def
generate_object_constant_decls
(
self
):
consts
=
[
(
len
(
c
.
cname
),
c
.
cname
,
c
)
consts
=
[(
len
(
c
.
cname
),
c
.
cname
,
c
)
for
c
in
self
.
py_constants
]
for
c
in
self
.
py_constants
]
consts
.
sort
()
consts
.
sort
()
decls_writer
=
self
.
parts
[
'decls'
]
decls_writer
=
self
.
parts
[
'decls'
]
for
_
,
cname
,
c
in
consts
:
for
_
,
cname
,
c
in
consts
:
...
@@ -1345,8 +1345,7 @@ class GlobalState(object):
...
@@ -1345,8 +1345,7 @@ class GlobalState(object):
py_strings
.
sort
()
py_strings
.
sort
()
w
=
self
.
parts
[
'pystring_table'
]
w
=
self
.
parts
[
'pystring_table'
]
w
.
putln
(
""
)
w
.
putln
(
""
)
w
.
putln
(
"static __Pyx_StringTabEntry %s[] = {"
%
w
.
putln
(
"static __Pyx_StringTabEntry %s[] = {"
%
Naming
.
stringtab_cname
)
Naming
.
stringtab_cname
)
for
c_cname
,
_
,
py_string
in
py_strings
:
for
c_cname
,
_
,
py_string
in
py_strings
:
if
not
py_string
.
is_str
or
not
py_string
.
encoding
or
\
if
not
py_string
.
is_str
or
not
py_string
.
encoding
or
\
py_string
.
encoding
in
(
'ASCII'
,
'USASCII'
,
'US-ASCII'
,
py_string
.
encoding
in
(
'ASCII'
,
'USASCII'
,
'US-ASCII'
,
...
@@ -1359,8 +1358,7 @@ class GlobalState(object):
...
@@ -1359,8 +1358,7 @@ class GlobalState(object):
"static PyObject *%s;"
%
py_string
.
cname
)
"static PyObject *%s;"
%
py_string
.
cname
)
if
py_string
.
py3str_cstring
:
if
py_string
.
py3str_cstring
:
w
.
putln
(
"#if PY_MAJOR_VERSION >= 3"
)
w
.
putln
(
"#if PY_MAJOR_VERSION >= 3"
)
w
.
putln
(
w
.
putln
(
"{&%s, %s, sizeof(%s), %s, %d, %d, %d},"
%
(
"{&%s, %s, sizeof(%s), %s, %d, %d, %d},"
%
(
py_string
.
cname
,
py_string
.
cname
,
py_string
.
py3str_cstring
.
cname
,
py_string
.
py3str_cstring
.
cname
,
py_string
.
py3str_cstring
.
cname
,
py_string
.
py3str_cstring
.
cname
,
...
@@ -1368,8 +1366,7 @@ class GlobalState(object):
...
@@ -1368,8 +1366,7 @@ class GlobalState(object):
py_string
.
intern
py_string
.
intern
))
))
w
.
putln
(
"#else"
)
w
.
putln
(
"#else"
)
w
.
putln
(
w
.
putln
(
"{&%s, %s, sizeof(%s), %s, %d, %d, %d},"
%
(
"{&%s, %s, sizeof(%s), %s, %d, %d, %d},"
%
(
py_string
.
cname
,
py_string
.
cname
,
c_cname
,
c_cname
,
c_cname
,
c_cname
,
...
...
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