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
04b5684d
Kaydet (Commit)
04b5684d
authored
May 18, 2010
tarafından
Barry Warsaw
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Repair test failure. Bug 8727.
üst
2b80fa69
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
3 deletions
+13
-3
_bootstrap.py
Lib/importlib/_bootstrap.py
+10
-2
test_file_loader.py
Lib/importlib/test/source/test_file_loader.py
+3
-0
test_import.py
Lib/test/test_import.py
+0
-1
No files found.
Lib/importlib/_bootstrap.py
Dosyayı görüntüle @
04b5684d
...
...
@@ -494,8 +494,16 @@ class _PyPycFileLoader(PyPycLoader, _PyFileLoader):
if
ext_type
==
imp
.
PY_COMPILED
:
# We don't really care what the extension on self._base_path is,
# as long as it has exactly one dot.
bytecode_path
=
imp
.
cache_from_source
(
self
.
_base_path
+
'.py'
)
return
(
bytecode_path
if
_path_exists
(
bytecode_path
)
else
None
)
source_path
=
self
.
_base_path
+
'.py'
pycache_path
=
imp
.
cache_from_source
(
source_path
)
legacy_path
=
self
.
_base_path
+
'.pyc'
# The rule is: if the source file exists, then Python always uses
# the __pycache__/foo.<tag>.pyc file. If the source file does not
# exist, then Python uses the legacy path.
pyc_path
=
(
pycache_path
if
_path_exists
(
source_path
)
else
legacy_path
)
return
(
pyc_path
if
_path_exists
(
pyc_path
)
else
None
)
return
super
()
.
_find_path
(
ext_type
)
@_check_name
...
...
Lib/importlib/test/source/test_file_loader.py
Dosyayı görüntüle @
04b5684d
...
...
@@ -10,6 +10,8 @@ import stat
import
sys
import
unittest
from
test.support
import
make_legacy_pyc
class
SimpleTest
(
unittest
.
TestCase
):
...
...
@@ -136,6 +138,7 @@ class BadBytecodeTest(unittest.TestCase):
file
.
write
(
new_bc
)
if
del_source
:
os
.
unlink
(
mapping
[
name
])
make_legacy_pyc
(
mapping
[
name
])
return
bytecode_path
@source_util.writes_bytecode_files
...
...
Lib/test/test_import.py
Dosyayı görüntüle @
04b5684d
...
...
@@ -142,7 +142,6 @@ class ImportTests(unittest.TestCase):
self
.
assertIs
(
orig_path
,
new_os
.
path
)
self
.
assertIsNot
(
orig_getenv
,
new_os
.
getenv
)
@unittest.expectedFailure
# Issue 8727 is tracking the fix.
def
test_module_with_large_stack
(
self
,
module
=
'longlist'
):
# Regression test for http://bugs.python.org/issue561858.
filename
=
module
+
'.py'
...
...
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