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
6965934d
Commit
6965934d
authored
Apr 26, 2008
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Plain Diff
merge
parents
32b1a50f
c37a4543
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
30 additions
and
32 deletions
+30
-32
Cython/Compiler/CmdLine.py
Cython/Compiler/CmdLine.py
+5
-0
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+4
-4
Cython/Compiler/Main.py
Cython/Compiler/Main.py
+4
-1
Cython/Compiler/ModuleNode.py
Cython/Compiler/ModuleNode.py
+5
-4
Demos/Setup.py
Demos/Setup.py
+12
-23
No files found.
Cython/Compiler/CmdLine.py
View file @
6965934d
...
...
@@ -27,6 +27,9 @@ Options:
performing any binary operations.
--cleanup <level> Release interned objects on python exit, for memory debugging.
Level indicates aggressiveness, default 0 releases nothing.
-w, --working <directory> Sets the working directory for Cython (the directory modules
are searched from)
-D, --no-docstrings Remove docstrings.
-a, --annotate Produce an colorized version of the source.
--convert-range Convert for loops using range() function to for...from loops.
...
...
@@ -104,6 +107,8 @@ def parse_command_line(args):
options
.
include_path
.
append
(
get_param
(
option
))
elif
option
==
"--include-dir"
:
options
.
include_path
.
append
(
pop_arg
())
elif
option
in
(
"-w"
,
"--working"
):
options
.
working_path
=
pop_arg
()
elif
option
in
(
"-o"
,
"--output-file"
):
options
.
output_file
=
pop_arg
()
elif
option
in
(
"-p"
,
"--embed-positions"
):
...
...
Cython/Compiler/ExprNodes.py
View file @
6965934d
...
...
@@ -4083,9 +4083,8 @@ bad:
cpp_exception_utility_code
=
[
"""
static int __Pyx_CppExn2PyErr(); /*proto*/
"""
,
"""
void __Pyx_CppExn2PyErr() {
#ifndef __Pyx_CppExn2PyErr
static void __Pyx_CppExn2PyErr() {
try {
if (PyErr_Occurred())
; // let the latest Python exn pass through and ignore the current one
...
...
@@ -4102,6 +4101,7 @@ void __Pyx_CppExn2PyErr() {
PyErr_SetString(PyExc_RuntimeError, "Unknown exception");
}
}
"""
]
#endif
"""
,
""
]
#------------------------------------------------------------------------------------
Cython/Compiler/Main.py
View file @
6965934d
...
...
@@ -328,6 +328,8 @@ def main(command_line = 0):
sources = args
if options.show_version:
sys.stderr.write("Cython version %s
\
n
" % Version.version)
if options.working_path!="":
os.chdir(options.working_path)
context = Context(options.include_path)
for source in sources:
try:
...
...
@@ -355,7 +357,8 @@ default_options = dict(
cplus = 0,
output_file = None,
generate_pxi = 0,
transforms = Transform.TransformSet())
transforms = Transform.TransformSet(),
working_path = "")
if sys.platform == "mac":
from Cython.Mac.MacSystem import c_compile, c_link, CCompilerError
...
...
Cython/Compiler/ModuleNode.py
View file @
6965934d
...
...
@@ -347,7 +347,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
self
.
generate_typeobject_predeclaration
(
entry
,
code
)
self
.
generate_exttype_vtable_struct
(
entry
,
code
)
self
.
generate_exttype_vtabptr_declaration
(
entry
,
code
)
def
generate_declarations_for_modules
(
self
,
env
,
modules
,
code
):
code
.
putln
(
""
)
code
.
putln
(
"/* Declarations */"
)
...
...
@@ -770,13 +770,14 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
"static void %s(PyObject *o) {"
%
scope
.
mangle_internal
(
"tp_dealloc"
))
py_attrs
=
[]
weakref_slot
=
scope
.
lookup_here
(
"__weakref__"
)
for
entry
in
scope
.
var_entries
:
if
entry
.
type
.
is_pyobject
and
entry
.
name
!=
"__weakref__"
:
if
entry
.
type
.
is_pyobject
and
entry
is
not
weakref_slot
:
py_attrs
.
append
(
entry
)
if
py_attrs
or
scope
.
lookup_here
(
"__weakref__"
)
:
if
py_attrs
or
weakref_slot
in
scope
.
var_entries
:
self
.
generate_self_cast
(
scope
,
code
)
self
.
generate_usr_dealloc_call
(
scope
,
code
)
if
scope
.
lookup_here
(
"__weakref__"
)
:
if
weakref_slot
in
scope
.
var_entries
:
code
.
putln
(
"if (p->__weakref__) PyObject_ClearWeakRefs(o);"
)
for
entry
in
py_attrs
:
code
.
put_xdecref
(
"p->%s"
%
entry
.
cname
,
entry
.
type
)
...
...
Demos/Setup.py
View file @
6965934d
import
glob
from
distutils.core
import
setup
from
distutils.extension
import
Extension
from
Cython.Distutils
import
build_ext
setup
(
name
=
'Demos'
,
ext_modules
=
[
ext_modules
=
[
Extension
(
"primes"
,
[
"primes.pyx"
]),
Extension
(
"spam"
,
[
"spam.pyx"
]),
# Extension("numeric_demo", ["numeric_demo.pyx"]),
Extension
(
"test"
,
[
"test.pyx"
]),
Extension
(
"func_pointers"
,
[
"func_pointers.pyx"
]),
# Extension("inplace", ["inplace.pyx"]),
# Extension("withGIL", ["withGIL.pyx"]),
Extension
(
"class_members"
,
[
"class_members.pyx"
]),
# Extension("inherit_bug", ["inherit_bug.pyx"]),
Extension
(
"override"
,
[
"override.pyx"
]),
Extension
(
"cond"
,
[
"cond.pyx"
]),
# Extension("submodule.test", ["submodule/test.pyx"]),
Extension
(
"errors"
,
[
"errors.pyx"
]),
Extension
(
"cpdef"
,
[
"cpdef.pyx"
]),
Extension
(
"range"
,
[
"range.pyx"
]),
Extension
(
"early_temps"
,
[
"early_temps.pyx"
]),
Extension
(
"ints"
,
[
"ints.pyx"
]),
Extension
(
"clear"
,
[
"clear.pyx"
]),
Extension
(
"detect_override"
,
[
"detect_override.pyx"
]),
Extension
(
"fixes"
,
[
"fixes.pyx"
]),
],
]
for
file
in
glob
.
glob
(
"*.pyx"
):
if
file
!=
"numeric_demo.pyx"
:
ext_modules
.
append
(
Extension
(
file
[:
-
4
],
[
file
]))
setup
(
name
=
'Demos'
,
cmdclass
=
{
'build_ext'
:
build_ext
},
# include_dirs = "/System/Library/Frameworks/Python.framework/Versions/2.3/include/python2.3/"
ext_modules
=
ext_modules
,
)
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