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
a33e11e4
Kaydet (Commit)
a33e11e4
authored
Haz 07, 2013
tarafından
Brett Cannon
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #17314: Stop using imp in multiprocessing.forking and move over
to importlib.
üst
22c039bf
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
9 deletions
+13
-9
forking.py
Lib/multiprocessing/forking.py
+11
-9
NEWS
Misc/NEWS
+2
-0
No files found.
Lib/multiprocessing/forking.py
Dosyayı görüntüle @
a33e11e4
...
...
@@ -450,6 +450,7 @@ def prepare(data):
# Main modules not actually called __main__.py may
# contain additional code that should still be executed
import
imp
import
importlib
if
main_path
is
None
:
dirs
=
None
...
...
@@ -460,16 +461,17 @@ def prepare(data):
assert
main_name
not
in
sys
.
modules
,
main_name
sys
.
modules
.
pop
(
'__mp_main__'
,
None
)
file
,
path_name
,
etc
=
imp
.
find_module
(
main_name
,
dirs
)
try
:
# We should not do 'imp.load_module("__main__", ...)'
# We should not try to load __main__
# since that would execute 'if __name__ == "__main__"'
# clauses, potentially causing a psuedo fork bomb.
main_module
=
imp
.
load_module
(
'__mp_main__'
,
file
,
path_name
,
etc
)
finally
:
if
file
:
file
.
close
()
loader
=
importlib
.
find_loader
(
main_name
,
path
=
dirs
)
main_module
=
imp
.
new_module
(
main_name
)
try
:
loader
.
init_module_attrs
(
main_module
)
except
AttributeError
:
# init_module_attrs is optional
pass
main_module
.
__name__
=
'__mp_main__'
code
=
loader
.
get_code
(
main_name
)
exec
(
code
,
main_module
.
__dict__
)
sys
.
modules
[
'__main__'
]
=
sys
.
modules
[
'__mp_main__'
]
=
main_module
Misc/NEWS
Dosyayı görüntüle @
a33e11e4
...
...
@@ -112,6 +112,8 @@ Core and Builtins
Library
-------
-
Issue
#
17314
:
Move
multiprocessing
.
forking
over
to
importlib
.
-
Issue
#
11959
:
SMTPServer
and
SMTPChannel
now
take
an
optional
map
,
use
of
which
avoids
affecting
global
state
.
...
...
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