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
02b9f9d6
Kaydet (Commit)
02b9f9d6
authored
Ock 07, 2014
tarafından
Eric Snow
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Remove more usage of APIs deprecated by PEP 451.
üst
3a62d14b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
14 deletions
+16
-14
EditorWindow.py
Lib/idlelib/EditorWindow.py
+4
-4
pkgutil.py
Lib/pkgutil.py
+7
-6
pyclbr.py
Lib/pyclbr.py
+5
-4
No files found.
Lib/idlelib/EditorWindow.py
Dosyayı görüntüle @
02b9f9d6
...
@@ -659,20 +659,20 @@ class EditorWindow(object):
...
@@ -659,20 +659,20 @@ class EditorWindow(object):
return
return
# XXX Ought to insert current file's directory in front of path
# XXX Ought to insert current file's directory in front of path
try
:
try
:
loader
=
importlib
.
find_loader
(
name
)
spec
=
importlib
.
find_spec
(
name
)
except
(
ValueError
,
ImportError
)
as
msg
:
except
(
ValueError
,
ImportError
)
as
msg
:
tkMessageBox
.
showerror
(
"Import error"
,
str
(
msg
),
parent
=
self
.
text
)
tkMessageBox
.
showerror
(
"Import error"
,
str
(
msg
),
parent
=
self
.
text
)
return
return
if
loader
is
None
:
if
spec
is
None
:
tkMessageBox
.
showerror
(
"Import error"
,
"module not found"
,
tkMessageBox
.
showerror
(
"Import error"
,
"module not found"
,
parent
=
self
.
text
)
parent
=
self
.
text
)
return
return
if
not
isinstance
(
loader
,
importlib
.
abc
.
SourceLoader
):
if
not
isinstance
(
spec
.
loader
,
importlib
.
abc
.
SourceLoader
):
tkMessageBox
.
showerror
(
"Import error"
,
"not a source-based module"
,
tkMessageBox
.
showerror
(
"Import error"
,
"not a source-based module"
,
parent
=
self
.
text
)
parent
=
self
.
text
)
return
return
try
:
try
:
file_path
=
loader
.
get_filename
(
name
)
file_path
=
spec
.
loader
.
get_filename
(
name
)
except
AttributeError
:
except
AttributeError
:
tkMessageBox
.
showerror
(
"Import error"
,
tkMessageBox
.
showerror
(
"Import error"
,
"loader does not support get_filename"
,
"loader does not support get_filename"
,
...
...
Lib/pkgutil.py
Dosyayı görüntüle @
02b9f9d6
...
@@ -554,13 +554,14 @@ def extend_path(path, name):
...
@@ -554,13 +554,14 @@ def extend_path(path, name):
finder
=
get_importer
(
dir
)
finder
=
get_importer
(
dir
)
if
finder
is
not
None
:
if
finder
is
not
None
:
portions
=
[]
if
hasattr
(
finder
,
'find_spec'
):
spec
=
finder
.
find_spec
(
final_name
)
if
spec
is
not
None
:
portions
=
spec
.
submodule_search_locations
or
[]
# Is this finder PEP 420 compliant?
# Is this finder PEP 420 compliant?
if
hasattr
(
finder
,
'find_loader'
):
elif
hasattr
(
finder
,
'find_loader'
):
loader
,
portions
=
finder
.
find_loader
(
final_name
)
_
,
portions
=
finder
.
find_loader
(
final_name
)
else
:
# No, no need to call it
loader
=
None
portions
=
[]
for
portion
in
portions
:
for
portion
in
portions
:
# XXX This may still add duplicate entries to path on
# XXX This may still add duplicate entries to path on
...
...
Lib/pyclbr.py
Dosyayı görüntüle @
02b9f9d6
...
@@ -140,13 +140,14 @@ def _readmodule(module, path, inpackage=None):
...
@@ -140,13 +140,14 @@ def _readmodule(module, path, inpackage=None):
search_path
=
path
search_path
=
path
else
:
else
:
search_path
=
path
+
sys
.
path
search_path
=
path
+
sys
.
path
loader
=
importlib
.
find_loader
(
fullmodule
,
search_path
)
# XXX This will change once issue19944 lands.
fname
=
loader
.
get_filename
(
fullmodule
)
spec
=
importlib
.
find_spec
(
fullmodule
,
search_path
)
fname
=
spec
.
loader
.
get_filename
(
fullmodule
)
_modules
[
fullmodule
]
=
dict
_modules
[
fullmodule
]
=
dict
if
loader
.
is_package
(
fullmodule
):
if
spec
.
loader
.
is_package
(
fullmodule
):
dict
[
'__path__'
]
=
[
os
.
path
.
dirname
(
fname
)]
dict
[
'__path__'
]
=
[
os
.
path
.
dirname
(
fname
)]
try
:
try
:
source
=
loader
.
get_source
(
fullmodule
)
source
=
spec
.
loader
.
get_source
(
fullmodule
)
if
source
is
None
:
if
source
is
None
:
return
dict
return
dict
except
(
AttributeError
,
ImportError
):
except
(
AttributeError
,
ImportError
):
...
...
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