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
2b8fc303
Kaydet (Commit)
2b8fc303
authored
Kas 01, 2013
tarafından
Brett Cannon
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Abstract out stat calls in importlib for easier experimentation.
üst
f6901c8b
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
5 deletions
+15
-5
_bootstrap.py
Lib/importlib/_bootstrap.py
+15
-5
importlib.h
Python/importlib.h
+0
-0
No files found.
Lib/importlib/_bootstrap.py
Dosyayı görüntüle @
2b8fc303
...
...
@@ -65,10 +65,20 @@ def _path_split(path):
return
''
,
path
def
_path_stat
(
path
):
"""Stat the path.
Made a separate function to make it easier to override in experiments
(e.g. cache stat results).
"""
return
_os
.
stat
(
path
)
def
_path_is_mode_type
(
path
,
mode
):
"""Test whether the path is the specified mode type."""
try
:
stat_info
=
_
os
.
stat
(
path
)
stat_info
=
_
path_
stat
(
path
)
except
OSError
:
return
False
return
(
stat_info
.
st_mode
&
0
o170000
)
==
mode
...
...
@@ -458,7 +468,7 @@ def _get_sourcefile(bytecode_path):
def
_calc_mode
(
path
):
"""Calculate the mode permissions for a bytecode file."""
try
:
mode
=
_
os
.
stat
(
path
)
.
st_mode
mode
=
_
path_
stat
(
path
)
.
st_mode
except
OSError
:
mode
=
0
o666
# We always ensure write access so we can update cached files
...
...
@@ -880,7 +890,7 @@ class WindowsRegistryFinder:
if
filepath
is
None
:
return
None
try
:
_
os
.
stat
(
filepath
)
_
path_
stat
(
filepath
)
except
OSError
:
return
None
for
loader
,
suffixes
in
_get_supported_file_loaders
():
...
...
@@ -1074,7 +1084,7 @@ class SourceFileLoader(FileLoader, SourceLoader):
def
path_stats
(
self
,
path
):
"""Return the metadata for the path."""
st
=
_
os
.
stat
(
path
)
st
=
_
path_
stat
(
path
)
return
{
'mtime'
:
st
.
st_mtime
,
'size'
:
st
.
st_size
}
def
_cache_bytecode
(
self
,
source_path
,
bytecode_path
,
data
):
...
...
@@ -1392,7 +1402,7 @@ class FileFinder:
is_namespace
=
False
tail_module
=
fullname
.
rpartition
(
'.'
)[
2
]
try
:
mtime
=
_
os
.
stat
(
self
.
path
or
_os
.
getcwd
())
.
st_mtime
mtime
=
_
path_
stat
(
self
.
path
or
_os
.
getcwd
())
.
st_mtime
except
OSError
:
mtime
=
-
1
if
mtime
!=
self
.
_path_mtime
:
...
...
Python/importlib.h
Dosyayı görüntüle @
2b8fc303
This diff is collapsed.
Click to expand it.
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