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
050929e9
Commit
050929e9
authored
Aug 29, 1994
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
err_clear: clear interpreter stack trace
parent
fca23180
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
40 deletions
+7
-40
Python/errors.c
Python/errors.c
+7
-40
No files found.
Python/errors.c
View file @
050929e9
/***********************************************************
Copyright 1991, 1992, 1993 by Stichting Mathematisch Centrum,
Copyright 1991, 1992, 1993
, 1994
by Stichting Mathematisch Centrum,
Amsterdam, The Netherlands.
All Rights Reserved
...
...
@@ -60,8 +60,6 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <errno.h>
#include "errcode.h"
extern
char
*
strerror
PROTO
((
int
));
/* Last exception stored by err_setval() */
...
...
@@ -100,10 +98,11 @@ err_setstr(exception, string)
XDECREF
(
value
);
}
int
object
*
err_occurred
()
{
return
last_exception
!=
NULL
;
return
last_exception
;
}
void
...
...
@@ -147,11 +146,10 @@ err_errno(exc)
object
*
exc
;
{
object
*
v
;
i
f
(
errno
==
EINTR
&&
intrcheck
())
{
err_set
(
KeyboardInterrupt
);
i
nt
i
=
errno
;
if
(
i
==
EINTR
&&
sigcheck
())
return
NULL
;
}
v
=
mkvalue
(
"(is)"
,
errno
,
strerror
(
errno
));
v
=
mkvalue
(
"(is)"
,
i
,
strerror
(
i
));
if
(
v
!=
NULL
)
{
err_setval
(
exc
,
v
);
DECREF
(
v
);
...
...
@@ -164,34 +162,3 @@ err_badcall()
{
err_setstr
(
SystemError
,
"bad argument to internal function"
);
}
/* Set the error appropriate to the given input error code (see errcode.h) */
void
err_input
(
err
)
int
err
;
{
switch
(
err
)
{
case
E_DONE
:
case
E_OK
:
break
;
case
E_SYNTAX
:
err_setstr
(
SyntaxError
,
"invalid syntax"
);
break
;
case
E_TOKEN
:
err_setstr
(
SyntaxError
,
"invalid token"
);
break
;
case
E_INTR
:
err_set
(
KeyboardInterrupt
);
break
;
case
E_NOMEM
:
err_nomem
();
break
;
case
E_EOF
:
err_setstr
(
SyntaxError
,
"unexpected EOF while parsing"
);
break
;
default:
err_setstr
(
SystemError
,
"unknown parsing error"
);
break
;
}
}
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