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
ec87a13e
Commit
ec87a13e
authored
Jun 11, 2014
by
Serhiy Storchaka
Browse files
Options
Browse Files
Download
Plain Diff
PyErr_NormalizeException doesn't like being called with an exception set
(issues #21677, #21310).
parents
915d1419
76d3f14e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
12 deletions
+12
-12
Modules/_io/_iomodule.c
Modules/_io/_iomodule.c
+4
-4
Modules/_io/bufferedio.c
Modules/_io/bufferedio.c
+4
-4
Modules/_io/textio.c
Modules/_io/textio.c
+4
-4
No files found.
Modules/_io/_iomodule.c
View file @
ec87a13e
...
@@ -470,14 +470,14 @@ io_open(PyObject *self, PyObject *args, PyObject *kwds)
...
@@ -470,14 +470,14 @@ io_open(PyObject *self, PyObject *args, PyObject *kwds)
if
(
_PyObject_CallMethodId
(
result
,
&
PyId_close
,
NULL
)
!=
NULL
)
if
(
_PyObject_CallMethodId
(
result
,
&
PyId_close
,
NULL
)
!=
NULL
)
PyErr_Restore
(
exc
,
val
,
tb
);
PyErr_Restore
(
exc
,
val
,
tb
);
else
{
else
{
PyObject
*
val2
;
PyObject
*
exc2
,
*
val2
,
*
tb2
;
PyErr_Fetch
(
&
exc2
,
&
val2
,
&
tb2
);
PyErr_NormalizeException
(
&
exc
,
&
val
,
&
tb
);
PyErr_NormalizeException
(
&
exc
,
&
val
,
&
tb
);
Py_XDECREF
(
exc
);
Py_XDECREF
(
exc
);
Py_XDECREF
(
tb
);
Py_XDECREF
(
tb
);
PyErr_Fetch
(
&
exc
,
&
val2
,
&
tb
);
PyErr_NormalizeException
(
&
exc2
,
&
val2
,
&
tb2
);
PyErr_NormalizeException
(
&
exc
,
&
val2
,
&
tb
);
PyException_SetContext
(
val2
,
val
);
PyException_SetContext
(
val2
,
val
);
PyErr_Restore
(
exc
,
val2
,
tb
);
PyErr_Restore
(
exc
2
,
val2
,
tb2
);
}
}
Py_DECREF
(
result
);
Py_DECREF
(
result
);
}
}
...
...
Modules/_io/bufferedio.c
View file @
ec87a13e
...
@@ -548,14 +548,14 @@ buffered_close(buffered *self, PyObject *args)
...
@@ -548,14 +548,14 @@ buffered_close(buffered *self, PyObject *args)
PyErr_Restore
(
exc
,
val
,
tb
);
PyErr_Restore
(
exc
,
val
,
tb
);
}
}
else
{
else
{
PyObject
*
val2
;
PyObject
*
exc2
,
*
val2
,
*
tb2
;
PyErr_Fetch
(
&
exc2
,
&
val2
,
&
tb2
);
PyErr_NormalizeException
(
&
exc
,
&
val
,
&
tb
);
PyErr_NormalizeException
(
&
exc
,
&
val
,
&
tb
);
Py_DECREF
(
exc
);
Py_DECREF
(
exc
);
Py_XDECREF
(
tb
);
Py_XDECREF
(
tb
);
PyErr_Fetch
(
&
exc
,
&
val2
,
&
tb
);
PyErr_NormalizeException
(
&
exc2
,
&
val2
,
&
tb2
);
PyErr_NormalizeException
(
&
exc
,
&
val2
,
&
tb
);
PyException_SetContext
(
val2
,
val
);
PyException_SetContext
(
val2
,
val
);
PyErr_Restore
(
exc
,
val2
,
tb
);
PyErr_Restore
(
exc
2
,
val2
,
tb2
);
}
}
}
}
...
...
Modules/_io/textio.c
View file @
ec87a13e
...
@@ -2619,14 +2619,14 @@ textiowrapper_close(textio *self, PyObject *args)
...
@@ -2619,14 +2619,14 @@ textiowrapper_close(textio *self, PyObject *args)
PyErr_Restore
(
exc
,
val
,
tb
);
PyErr_Restore
(
exc
,
val
,
tb
);
}
}
else
{
else
{
PyObject
*
val2
;
PyObject
*
exc2
,
*
val2
,
*
tb2
;
PyErr_Fetch
(
&
exc2
,
&
val2
,
&
tb2
);
PyErr_NormalizeException
(
&
exc
,
&
val
,
&
tb
);
PyErr_NormalizeException
(
&
exc
,
&
val
,
&
tb
);
Py_DECREF
(
exc
);
Py_DECREF
(
exc
);
Py_XDECREF
(
tb
);
Py_XDECREF
(
tb
);
PyErr_Fetch
(
&
exc
,
&
val2
,
&
tb
);
PyErr_NormalizeException
(
&
exc2
,
&
val2
,
&
tb2
);
PyErr_NormalizeException
(
&
exc
,
&
val2
,
&
tb
);
PyException_SetContext
(
val2
,
val
);
PyException_SetContext
(
val2
,
val
);
PyErr_Restore
(
exc
,
val2
,
tb
);
PyErr_Restore
(
exc
2
,
val2
,
tb2
);
}
}
}
}
return
res
;
return
res
;
...
...
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