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
1d6af707
Commit
1d6af707
authored
Mar 21, 2010
by
Victor Stinner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert my change on initsite(): don't change import site error handler in 3.1,
as I did for 2.6. But fix the other bugs :-)
parent
ffbc2f63
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
9 deletions
+14
-9
Misc/NEWS
Misc/NEWS
+0
-5
Python/pythonrun.c
Python/pythonrun.c
+14
-4
No files found.
Misc/NEWS
View file @
1d6af707
...
...
@@ -25,11 +25,6 @@ What's New in Python 3.1.2?
Core and Builtins
-----------------
- Issue #3137: Don't ignore errors at startup, especially a keyboard interrupt
(SIGINT). If an error occurs while importing the site module, the error is
printed and Python exits. Initialize the GIL before importing the site
module.
- Issue #7173: Generator finalization could invalidate sys.exc_info().
Library
...
...
Python/pythonrun.c
View file @
1d6af707
...
...
@@ -712,12 +712,22 @@ initmain(void)
static
void
initsite
(
void
)
{
PyObject
*
m
;
PyObject
*
m
,
*
f
;
m
=
PyImport_ImportModule
(
"site"
);
if
(
m
==
NULL
)
{
PyErr_Print
();
Py_Finalize
();
exit
(
1
);
f
=
PySys_GetObject
(
"stderr"
);
if
(
f
==
NULL
||
f
==
Py_None
)
return
;
if
(
Py_VerboseFlag
)
{
PyFile_WriteString
(
"'import site' failed; traceback:
\n
"
,
f
);
PyErr_Print
();
}
else
{
PyFile_WriteString
(
"'import site' failed; use -v for traceback
\n
"
,
f
);
PyErr_Clear
();
}
}
else
{
Py_DECREF
(
m
);
...
...
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