Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
af5dfb4c
Kaydet (Commit)
af5dfb4c
authored
May 14, 1997
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
One last rename glitch: import_modules -> _PyImport_Modules.
üst
39d6ae7b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
17 deletions
+17
-17
import.c
Python/import.c
+15
-15
importdl.c
Python/importdl.c
+1
-1
importdl.h
Python/importdl.h
+1
-1
No files found.
Python/import.c
Dosyayı görüntüle @
af5dfb4c
...
...
@@ -61,7 +61,7 @@ extern long PyOS_GetLastModificationTime(); /* In getmtime.c */
/* New way to come up with the magic number: (YEAR-1995), MONTH, DAY */
#define MAGIC (20121 | ((long)'\r'<<16) | ((long)'\n'<<24))
PyObject
*
import_m
odules
;
/* This becomes sys.modules */
PyObject
*
_PyImport_M
odules
;
/* This becomes sys.modules */
/* Initialize things */
...
...
@@ -69,9 +69,9 @@ PyObject *import_modules; /* This becomes sys.modules */
void
PyImport_Init
()
{
if
(
import_m
odules
!=
NULL
)
if
(
_PyImport_M
odules
!=
NULL
)
Py_FatalError
(
"duplicate initimport() call"
);
if
((
import_m
odules
=
PyDict_New
())
==
NULL
)
if
((
_PyImport_M
odules
=
PyDict_New
())
==
NULL
)
Py_FatalError
(
"no mem for dictionary of modules"
);
if
(
Py_OptimizeFlag
)
{
/* Replace ".pyc" with ".pyo" in import_filetab */
...
...
@@ -89,9 +89,9 @@ PyImport_Init()
void
PyImport_Cleanup
()
{
if
(
import_m
odules
!=
NULL
)
{
PyObject
*
tmp
=
import_m
odules
;
import_m
odules
=
NULL
;
if
(
_PyImport_M
odules
!=
NULL
)
{
PyObject
*
tmp
=
_PyImport_M
odules
;
_PyImport_M
odules
=
NULL
;
/* This deletes all modules from sys.modules.
When a module is deallocated, it in turn clears its
dictionary, thus hopefully breaking any circular
...
...
@@ -118,7 +118,7 @@ PyImport_GetMagicNumber()
PyObject
*
PyImport_GetModuleDict
()
{
return
import_m
odules
;
return
_PyImport_M
odules
;
}
...
...
@@ -134,18 +134,18 @@ PyImport_AddModule(name)
{
PyObject
*
m
;
if
(
import_m
odules
==
NULL
)
{
if
(
_PyImport_M
odules
==
NULL
)
{
PyErr_SetString
(
PyExc_SystemError
,
"sys.modules has been deleted"
);
return
NULL
;
}
if
((
m
=
PyDict_GetItemString
(
import_m
odules
,
name
))
!=
NULL
&&
if
((
m
=
PyDict_GetItemString
(
_PyImport_M
odules
,
name
))
!=
NULL
&&
PyModule_Check
(
m
))
return
m
;
m
=
PyModule_New
(
name
);
if
(
m
==
NULL
)
return
NULL
;
if
(
PyDict_SetItemString
(
import_m
odules
,
name
,
m
)
!=
0
)
{
if
(
PyDict_SetItemString
(
_PyImport_M
odules
,
name
,
m
)
!=
0
)
{
Py_DECREF
(
m
);
return
NULL
;
}
...
...
@@ -661,12 +661,12 @@ PyImport_ImportModule(name)
{
PyObject
*
m
;
if
(
import_m
odules
==
NULL
)
{
if
(
_PyImport_M
odules
==
NULL
)
{
PyErr_SetString
(
PyExc_SystemError
,
"sys.modules has been deleted"
);
return
NULL
;
}
if
((
m
=
PyDict_GetItemString
(
import_m
odules
,
name
))
!=
NULL
)
{
if
((
m
=
PyDict_GetItemString
(
_PyImport_M
odules
,
name
))
!=
NULL
)
{
Py_INCREF
(
m
);
}
else
{
...
...
@@ -675,7 +675,7 @@ PyImport_ImportModule(name)
(
i
=
PyImport_ImportFrozenModule
(
name
)))
{
if
(
i
<
0
)
return
NULL
;
if
((
m
=
PyDict_GetItemString
(
import_m
odules
,
if
((
m
=
PyDict_GetItemString
(
_PyImport_M
odules
,
name
))
==
NULL
)
{
if
(
PyErr_Occurred
()
==
NULL
)
PyErr_SetString
(
PyExc_SystemError
,
...
...
@@ -710,12 +710,12 @@ PyImport_ReloadModule(m)
name
=
PyModule_GetName
(
m
);
if
(
name
==
NULL
)
return
NULL
;
if
(
import_m
odules
==
NULL
)
{
if
(
_PyImport_M
odules
==
NULL
)
{
PyErr_SetString
(
PyExc_SystemError
,
"sys.modules has been deleted"
);
return
NULL
;
}
if
(
m
!=
PyDict_GetItemString
(
import_m
odules
,
name
))
{
if
(
m
!=
PyDict_GetItemString
(
_PyImport_M
odules
,
name
))
{
PyErr_SetString
(
PyExc_ImportError
,
"reload() module not in sys.modules"
);
return
NULL
;
...
...
Python/importdl.c
Dosyayı görüntüle @
af5dfb4c
...
...
@@ -527,7 +527,7 @@ _PyImport_LoadDynamicModule(name, pathname, fp)
(
*
p
)();
/* XXX Need check for err_occurred() here */
m
=
PyDict_GetItemString
(
import_m
odules
,
name
);
m
=
PyDict_GetItemString
(
_PyImport_M
odules
,
name
);
if
(
m
==
NULL
)
{
if
(
PyErr_Occurred
()
==
NULL
)
PyErr_SetString
(
PyExc_SystemError
,
...
...
Python/importdl.h
Dosyayı görüntüle @
af5dfb4c
...
...
@@ -42,7 +42,7 @@ extern struct filedescr {
enum
filetype
type
;
}
_PyImport_Filetab
[];
extern
PyObject
*
import_m
odules
;
extern
PyObject
*
_PyImport_M
odules
;
extern
PyObject
*
_PyImport_LoadDynamicModule
Py_PROTO
((
char
*
name
,
char
*
pathname
,
FILE
*
));
...
...
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