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
88fa79a1
Unverified
Kaydet (Commit)
88fa79a1
authored
Ock 30, 2018
tarafından
Benjamin Peterson
Kaydeden (comit)
GitHub
Ock 30, 2018
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
[3.6] replace dynamic import with 'exec' with importlib.import_module (GH-5433) (GH-5440)
(cherry picked from commit
77526f05
)
üst
05f91a42
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
test_hashlib.py
Lib/test/test_hashlib.py
+4
-3
No files found.
Lib/test/test_hashlib.py
Dosyayı görüntüle @
88fa79a1
...
...
@@ -9,6 +9,7 @@
import
array
from
binascii
import
unhexlify
import
hashlib
import
importlib
import
itertools
import
os
import
sys
...
...
@@ -86,11 +87,11 @@ class HashLibTestCase(unittest.TestCase):
def
_conditional_import_module
(
self
,
module_name
):
"""Import a module and return a reference to it or None on failure."""
try
:
exec
(
'import '
+
module_name
)
except
Import
Error
as
error
:
return
importlib
.
import_module
(
module_name
)
except
ModuleNotFound
Error
as
error
:
if
self
.
_warn_on_extension_import
:
warnings
.
warn
(
'Did a C extension fail to compile?
%
s'
%
error
)
return
locals
()
.
get
(
module_name
)
return
None
def
__init__
(
self
,
*
args
,
**
kwargs
):
algorithms
=
set
()
...
...
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