Skip to content

Commit 286d5e9

Browse files
author
christian.heimes
committed
More PyImport_ImportModule -> PyImport_ImportModuleNoBlock
git-svn-id: http://svn.python.org/projects/python/branches/py3k@59681 6015fed2-1504-0410-9fe1-9d1591cc4771
1 parent aabe050 commit 286d5e9

4 files changed

Lines changed: 5 additions & 5 deletions

File tree

Parser/tokenizer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ fp_setreadl(struct tok_state *tok, const char* enc)
452452
{
453453
PyObject *readline = NULL, *stream = NULL, *io = NULL;
454454

455-
io = PyImport_ImportModule("io");
455+
io = PyImport_ImportModuleNoBlock("io");
456456
if (io == NULL)
457457
goto cleanup;
458458

Python/ast.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ new_identifier(const char* n, PyArena *arena)
5656
identifier; if so, normalize to NFKC. */
5757
for (; *u; u++) {
5858
if (*u >= 128) {
59-
PyObject *m = PyImport_ImportModule("unicodedata");
59+
PyObject *m = PyImport_ImportModuleNoBlock("unicodedata");
6060
PyObject *id2;
6161
if (!m)
6262
return NULL;

Python/bltinmodule.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ static PyObject *
281281
builtin_filter(PyObject *self, PyObject *args)
282282
{
283283
PyObject *itertools, *ifilter, *result;
284-
itertools = PyImport_ImportModule("itertools");
284+
itertools = PyImport_ImportModuleNoBlock("itertools");
285285
if (itertools == NULL)
286286
return NULL;
287287
ifilter = PyObject_GetAttrString(itertools, "ifilter");
@@ -796,7 +796,7 @@ static PyObject *
796796
builtin_map(PyObject *self, PyObject *args)
797797
{
798798
PyObject *itertools, *imap, *result;
799-
itertools = PyImport_ImportModule("itertools");
799+
itertools = PyImport_ImportModuleNoBlock("itertools");
800800
if (itertools == NULL)
801801
return NULL;
802802
imap = PyObject_GetAttrString(itertools, "imap");

Python/codecs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -850,7 +850,7 @@ static int _PyCodecRegistry_Init(void)
850850
interp->codec_error_registry == NULL)
851851
Py_FatalError("can't initialize codec registry");
852852

853-
mod = PyImport_ImportModuleLevel("encodings", NULL, NULL, NULL, 0);
853+
mod = PyImport_ImportModuleNoBlock("encodings");
854854
if (mod == NULL) {
855855
if (PyErr_ExceptionMatches(PyExc_ImportError)) {
856856
/* Ignore ImportErrors... this is done so that

0 commit comments

Comments
 (0)