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
f6159408
Commit
f6159408
authored
Jul 07, 2018
by
gabrieldemarmiesse
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed an outdated pxd, added a declaration of exc.pxd and made two examples for exceptions.
parent
7f3987e0
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
24 additions
and
630 deletions
+24
-630
Cython/Includes/Deprecated/python2.5.pxd
Cython/Includes/Deprecated/python2.5.pxd
+0
-622
Cython/Includes/cpython/exc.pxd
Cython/Includes/cpython/exc.pxd
+7
-0
docs/examples/tutorial/external/keyword_args_call.pyx
docs/examples/tutorial/external/keyword_args_call.pyx
+1
-1
docs/examples/userguide/language_basics/open_file.pyx
docs/examples/userguide/language_basics/open_file.pyx
+14
-5
docs/src/userguide/extension_types.rst
docs/src/userguide/extension_types.rst
+1
-1
docs/src/userguide/parallelism.rst
docs/src/userguide/parallelism.rst
+1
-1
No files found.
Cython/Includes/Deprecated/python2.5.pxd
deleted
100644 → 0
View file @
7f3987e0
This diff is collapsed.
Click to expand it.
Cython/Includes/cpython/exc.pxd
View file @
f6159408
...
...
@@ -153,6 +153,13 @@ cdef extern from "Python.h":
# PyErr_SetFromErrno(type);" when the system call returns an
# error.
PyObject
*
PyErr_SetFromErrnoWithFilenameObject
(
object
type
,
object
filenameObject
)
except
NULL
# Similar to PyErr_SetFromErrno(), with the additional behavior
# that if filenameObject is not NULL, it is passed to the
# constructor of type as a third parameter.
# In the case of OSError exception, this is used to define
# the filename attribute of the exception instance.
PyObject
*
PyErr_SetFromErrnoWithFilename
(
object
type
,
char
*
filename
)
except
NULL
# Return value: Always NULL. Similar to PyErr_SetFromErrno(),
# with the additional behavior that if filename is not NULL, it is
...
...
docs/examples/tutorial/external/keyword_args_call.pyx
View file @
f6159408
...
...
@@ -4,4 +4,4 @@ cdef extern from "string.h":
cdef
char
*
data
=
"hfvcakdfagbcffvschvxcdfgccbcfhvgcsnfxjh"
cdef
char
*
pos
=
strstr
(
needle
=
'akd'
,
haystack
=
data
)
print
(
pos
!=
NULL
)
print
(
pos
is
not
NULL
)
docs/examples/userguide/language_basics/open_file.pyx
View file @
f6159408
from
libc.stdio
cimport
FILE
,
fopen
from
libc.stdlib
cimport
malloc
,
free
from
cpython.exc
cimport
PyErr_SetFromErrnoWithFilenameObject
def
main
():
def
open_file
():
cdef
FILE
*
p
p
=
fopen
(
"spam.txt"
,
"r"
)
if
p
==
NULL
:
raise
OSError
(
"Couldn't open the spam file"
)
# ...
if
p
is
NULL
:
PyErr_SetFromErrnoWithFilenameObject
(
OSError
,
"spam.txt"
)
...
def
allocating_memory
(
number
=
10
):
cdef
double
*
my_array
=
<
double
*>
malloc
(
number
*
sizeof
(
double
))
if
not
my_array
:
raise
MemoryError
()
...
free
(
my_array
)
docs/src/userguide/extension_types.rst
View file @
f6159408
...
...
@@ -419,7 +419,7 @@ compatible types.::
cdef void* ptr
def __dealloc__(self):
if self.ptr
!=
NULL:
if self.ptr
is not
NULL:
free(self.ptr)
@staticmethod
...
...
docs/src/userguide/parallelism.rst
View file @
f6159408
...
...
@@ -131,7 +131,7 @@ It currently supports OpenMP, but later on more backends might be supported.
with nogil, parallel():
local_buf = <int *> malloc(sizeof(int) * size)
if local_buf
==
NULL:
if local_buf
is
NULL:
abort()
# populate our local buffer in a sequential loop
...
...
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