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
2f54b98c
Kaydet (Commit)
2f54b98c
authored
Tem 14, 2012
tarafından
Nick Coghlan
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Merge fix for #15230 from 3.2
üst
045bd534
761bb113
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
2 deletions
+9
-2
runpy.py
Lib/runpy.py
+4
-2
test_runpy.py
Lib/test/test_runpy.py
+0
-0
NEWS
Misc/NEWS
+5
-0
No files found.
Lib/runpy.py
Dosyayı görüntüle @
2f54b98c
...
...
@@ -70,6 +70,7 @@ def _run_code(code, run_globals, init_globals=None,
run_globals
.
update
(
__name__
=
mod_name
,
__file__
=
mod_fname
,
__cached__
=
None
,
__doc__
=
None
,
__loader__
=
mod_loader
,
__package__
=
pkg_name
)
exec
(
code
,
run_globals
)
...
...
@@ -233,12 +234,14 @@ def run_path(path_name, init_globals=None, run_name=None):
"""
if
run_name
is
None
:
run_name
=
"<run_path>"
pkg_name
=
run_name
.
rpartition
(
"."
)[
0
]
importer
=
_get_importer
(
path_name
)
if
isinstance
(
importer
,
(
type
(
None
),
imp
.
NullImporter
)):
# Not a valid sys.path entry, so run the code directly
# execfile() doesn't help as we want to allow compiled files
code
=
_get_code_from_file
(
path_name
)
return
_run_module_code
(
code
,
init_globals
,
run_name
,
path_name
)
return
_run_module_code
(
code
,
init_globals
,
run_name
,
path_name
,
pkg_name
=
pkg_name
)
else
:
# Importer is defined for path, so add it to
# the start of sys.path
...
...
@@ -257,7 +260,6 @@ def run_path(path_name, init_globals=None, run_name=None):
mod_name
,
loader
,
code
,
fname
=
_get_main_module_details
()
finally
:
sys
.
modules
[
main_name
]
=
saved_main
pkg_name
=
""
with
_TempModule
(
run_name
)
as
temp_module
,
\
_ModifiedArgv0
(
path_name
):
mod_globals
=
temp_module
.
module
.
__dict__
...
...
Lib/test/test_runpy.py
Dosyayı görüntüle @
2f54b98c
This diff is collapsed.
Click to expand it.
Misc/NEWS
Dosyayı görüntüle @
2f54b98c
...
...
@@ -35,6 +35,9 @@ Core and Builtins
Library
-------
-
Issue
#
15230
:
runpy
.
run_path
now
correctly
sets
__package__
as
described
in
the
documentation
-
Issue
#
15315
:
Support
VS
2010
in
distutils
cygwincompiler
.
-
Issue
#
15294
:
Fix
a
regression
in
pkgutil
.
extend_path
()
's handling of
...
...
@@ -133,6 +136,8 @@ Documentation
Tests
-----
-
Issue
#
15230
:
Adopted
a
more
systematic
approach
in
the
runpy
tests
-
Issue
#
15300
:
Ensure
the
temporary
test
working
directories
are
in
the
same
parent
folder
when
running
tests
in
multiprocess
mode
from
a
Python
build
.
Patch
by
Chris
Jerdonek
.
...
...
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