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
4afab6b3
Kaydet (Commit)
4afab6b3
authored
Şub 21, 2009
tarafından
Brett Cannon
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Separate out finder for source and source/bytecode.
üst
2dee597e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
10 deletions
+21
-10
NOTES
Lib/importlib/NOTES
+9
-6
_bootstrap.py
Lib/importlib/_bootstrap.py
+10
-2
test_case_sensitivity.py
Lib/importlib/test/source/test_case_sensitivity.py
+1
-1
test_finder.py
Lib/importlib/test/source/test_finder.py
+1
-1
No files found.
Lib/importlib/NOTES
Dosyayı görüntüle @
4afab6b3
...
...
@@ -5,19 +5,22 @@ to do
subclass of source support (makes it nicer for VMs that don't use CPython
bytecode).
+ ExtensionFileFinder
+ PyFileFinder
+ PyPycFileFinder
+ PyFileLoader
+ PyLoader (for ABC)
- get_code for source only
+ PyFileLoader(PyLoader)
- get_data
- source_mtime
- source_path
+ PyPycFileLoader(PyFileLoader)
+PyPycLoader (PyLoader, for ABC)
- get_code for source and bytecode
+ PyPycFileLoader(PyPycLoader, PyFileLoader)
- get_code
- bytecode_path
- write_bytecode
...
...
Lib/importlib/_bootstrap.py
Dosyayı görüntüle @
4afab6b3
...
...
@@ -592,10 +592,18 @@ class PyFileFinder(FileFinder):
# Make sure that Python source files are listed first! Needed for an
# optimization by the loader.
self
.
_suffixes
=
suffix_list
(
imp
.
PY_SOURCE
)
self
.
_suffixes
+=
suffix_list
(
imp
.
PY_COMPILED
)
super
()
.
__init__
(
path_entry
)
class
PyPycFileFinder
(
PyFileFinder
):
"""Finder for source and bytecode files."""
def
__init__
(
self
,
path_entry
):
super
()
.
__init__
(
path_entry
)
self
.
_suffixes
+=
suffix_list
(
imp
.
PY_COMPILED
)
class
PathFinder
:
"""Meta path finder for sys.(path|path_hooks|path_importer_cache)."""
...
...
@@ -659,7 +667,7 @@ class PathFinder:
return
None
_DEFAULT_PATH_HOOK
=
chained_path_hook
(
ExtensionFileFinder
,
PyFileFinder
)
_DEFAULT_PATH_HOOK
=
chained_path_hook
(
ExtensionFileFinder
,
Py
Pyc
FileFinder
)
class
_DefaultPathFinder
(
PathFinder
):
...
...
Lib/importlib/test/source/test_case_sensitivity.py
Dosyayı görüntüle @
4afab6b3
...
...
@@ -19,7 +19,7 @@ class CaseSensitivityTest(unittest.TestCase):
assert
name
!=
name
.
lower
()
def
find
(
self
,
path
):
finder
=
importlib
.
PyFileFinder
(
path
)
finder
=
importlib
.
Py
Pyc
FileFinder
(
path
)
return
finder
.
find_module
(
self
.
name
)
def
sensitivity_test
(
self
):
...
...
Lib/importlib/test/source/test_finder.py
Dosyayı görüntüle @
4afab6b3
...
...
@@ -32,7 +32,7 @@ class FinderTests(abc.FinderTests):
"""
def
import_
(
self
,
root
,
module
):
finder
=
importlib
.
PyFileFinder
(
root
)
finder
=
importlib
.
Py
Pyc
FileFinder
(
root
)
return
finder
.
find_module
(
module
)
def
run_test
(
self
,
test
,
create
=
None
,
*
,
compile_
=
None
,
unlink
=
None
):
...
...
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