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
b5c793a0
Kaydet (Commit)
b5c793a0
authored
Şub 20, 2012
tarafından
Antoine Pitrou
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #14063: fix test_importlib failure under OS X case-insensitive filesystems
(regression)
üst
6ddac006
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
11 deletions
+15
-11
_bootstrap.py
Lib/importlib/_bootstrap.py
+15
-11
No files found.
Lib/importlib/_bootstrap.py
Dosyayı görüntüle @
b5c793a0
...
@@ -762,13 +762,12 @@ class _FileFinder:
...
@@ -762,13 +762,12 @@ class _FileFinder:
self
.
path
=
path
or
'.'
self
.
path
=
path
or
'.'
self
.
_path_mtime
=
-
1
self
.
_path_mtime
=
-
1
self
.
_path_cache
=
set
()
self
.
_path_cache
=
set
()
self
.
_relaxed_path_cache
=
set
()
self
.
_cache_refresh
=
0
self
.
_cache_refresh
=
0
def
find_module
(
self
,
fullname
):
def
find_module
(
self
,
fullname
):
"""Try to find a loader for the specified module."""
"""Try to find a loader for the specified module."""
tail_module
=
fullname
.
rpartition
(
'.'
)[
2
]
tail_module
=
fullname
.
rpartition
(
'.'
)[
2
]
if
_relax_case
():
tail_module
=
tail_module
.
lower
()
try
:
try
:
mtime
=
_os
.
stat
(
self
.
path
)
.
st_mtime
mtime
=
_os
.
stat
(
self
.
path
)
.
st_mtime
except
OSError
:
except
OSError
:
...
@@ -777,8 +776,14 @@ class _FileFinder:
...
@@ -777,8 +776,14 @@ class _FileFinder:
self
.
_fill_cache
()
self
.
_fill_cache
()
self
.
_path_mtime
=
mtime
self
.
_path_mtime
=
mtime
self
.
_cache_refresh
=
_cache_refresh
self
.
_cache_refresh
=
_cache_refresh
cache
=
self
.
_path_cache
# tail_module keeps the original casing, for __file__ and friends
if
tail_module
in
cache
:
if
_relax_case
():
cache
=
self
.
_relaxed_path_cache
cache_module
=
tail_module
.
lower
()
else
:
cache
=
self
.
_path_cache
cache_module
=
tail_module
if
cache_module
in
cache
:
base_path
=
_path_join
(
self
.
path
,
tail_module
)
base_path
=
_path_join
(
self
.
path
,
tail_module
)
if
_path_isdir
(
base_path
):
if
_path_isdir
(
base_path
):
for
suffix
,
loader
in
self
.
packages
:
for
suffix
,
loader
in
self
.
packages
:
...
@@ -790,9 +795,8 @@ class _FileFinder:
...
@@ -790,9 +795,8 @@ class _FileFinder:
msg
=
"Not importing directory {}: missing __init__"
msg
=
"Not importing directory {}: missing __init__"
_warnings
.
warn
(
msg
.
format
(
base_path
),
ImportWarning
)
_warnings
.
warn
(
msg
.
format
(
base_path
),
ImportWarning
)
for
suffix
,
loader
in
self
.
modules
:
for
suffix
,
loader
in
self
.
modules
:
mod_filename
=
tail_module
+
suffix
if
cache_module
+
suffix
in
cache
:
if
mod_filename
in
cache
:
full_path
=
_path_join
(
self
.
path
,
tail_module
+
suffix
)
full_path
=
_path_join
(
self
.
path
,
mod_filename
)
if
_path_isfile
(
full_path
):
if
_path_isfile
(
full_path
):
return
loader
(
fullname
,
full_path
)
return
loader
(
fullname
,
full_path
)
return
None
return
None
...
@@ -801,10 +805,10 @@ class _FileFinder:
...
@@ -801,10 +805,10 @@ class _FileFinder:
"""Fill the cache of potential modules and packages for this directory."""
"""Fill the cache of potential modules and packages for this directory."""
path
=
self
.
path
path
=
self
.
path
contents
=
_os
.
listdir
(
path
)
contents
=
_os
.
listdir
(
path
)
if
_relax_case
():
# We store two cached versions, to handle runtime changes of the
self
.
_path_cache
=
set
(
fn
.
lower
()
for
fn
in
contents
)
# PYTHONCASEOK environment variable.
else
:
self
.
_path_cache
=
set
(
contents
)
self
.
_path_cache
=
set
(
contents
)
self
.
_relaxed_path_cache
=
set
(
fn
.
lower
()
for
fn
in
contents
)
class
_SourceFinderDetails
:
class
_SourceFinderDetails
:
...
...
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