Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
8c891ae5
Commit
8c891ae5
authored
Dec 19, 2000
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Document Pyerr_Warn().
parent
ce0ad937
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
0 deletions
+34
-0
Doc/api/api.tex
Doc/api/api.tex
+34
-0
No files found.
Doc/api/api.tex
View file @
8c891ae5
...
...
@@ -945,6 +945,40 @@ operation (e.g. a Python/C API function) was invoked with an illegal
argument. It is mostly for internal use.
\end{cfuncdesc}
\begin{cfuncdesc}
{
int
}{
PyErr
_
Warn
}{
PyObject *category, char *message
}
Issue a warning message. The
\var
{
category
}
argument is a warning
category (see below) or NULL; the
\var
{
message
}
argument is a message
string.
This function normally prints a warning message to
\var
{
sys.stderr
}
;
however, it is also possible that the user has specified that warnings
are to be turned into errors, and in that case this will raise an
exception. It is also possible that the function raises an exception
because of a problem with the warning machinery (the implementation
imports the
\module
{
warnings
}
module to do the heavy lifting). The
return value is
\code
{
0
}
if no exception is raised, or
\code
{
-1
}
if
an exception is raised. (It is not possible to determine whether a
warning message is actually printed, nor what the reason is for the
exception; this is intentional.) If an exception is raised, the
caller should do its normal exception handling (e.g. DECREF owned
references and return an error value).
Warning categories must be subclasses of
\cdata
{
Warning
}
; the default
warning category is
\cdata
{
RuntimeWarning
}
. The standard Python
warning categories are available as global variables whose names are
\samp
{
PyExc
_}
followed by the Python exception name. These have the
type
\ctype
{
PyObject*
}
; they are all class objects. Their names are
\cdata
{
PyExc
_
Warning
}
,
\cdata
{
PyExc
_
UserWarning
}
,
\cdata
{
PyExc
_
DeprecationWarning
}
,
\cdata
{
PyExc
_
SyntaxWarning
}
, and
\cdata
{
PyExc
_
RuntimeWarning
}
.
\cdata
{
PyExc
_
Warning
}
is a subclass of
\cdata
{
PyExc
_
Exception
}
; the other warning categories are subclasses
of
\cdata
{
PyExc
_
Warning
}
.
For information about warning control, see the documentation for the
\module
{
warnings
}
module and the
\samp
{
-W
}
option in the command line
documentation. There is no C API for warning control.
\end{cfuncdesc}
\begin{cfuncdesc}
{
int
}{
PyErr
_
CheckSignals
}{}
This function interacts with Python's signal handling. It checks
whether a signal has been sent to the processes and if so, invokes the
...
...
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