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
5c089314
Kaydet (Commit)
5c089314
authored
Nis 29, 2013
tarafından
Benjamin Peterson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
merge 3.3
üst
91c2f37e
7d110042
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
1 deletion
+11
-1
test_import.py
Lib/test/test_import.py
+7
-0
NEWS
Misc/NEWS
+2
-0
import.c
Python/import.c
+2
-1
No files found.
Lib/test/test_import.py
Dosyayı görüntüle @
5c089314
...
...
@@ -324,6 +324,13 @@ class ImportTests(unittest.TestCase):
except
ImportError
:
self
.
fail
(
"fromlist must allow bogus names"
)
@cpython_only
def
test_delete_builtins_import
(
self
):
args
=
[
"-c"
,
"del __builtins__.__import__; import os"
]
popen
=
script_helper
.
spawn_python
(
*
args
)
stdout
,
stderr
=
popen
.
communicate
()
self
.
assertIn
(
b
"ImportError"
,
stdout
)
@skip_if_dont_write_bytecode
class
FilePermissionTests
(
unittest
.
TestCase
):
...
...
Misc/NEWS
Dosyayı görüntüle @
5c089314
...
...
@@ -10,6 +10,8 @@ What's New in Python 3.4.0 Alpha 1?
Core and Builtins
-----------------
- Issue #17867: Raise an ImportError if __import__ is not found in __builtins__.
- Issue #17857: Prevent build failures with pre-3.5.0 versions of sqlite3,
such as was shipped with Centos 5 and Mac OS X 10.4.
...
...
Python/import.c
Dosyayı görüntüle @
5c089314
...
...
@@ -1403,7 +1403,8 @@ PyImport_ImportModuleLevelObject(PyObject *name, PyObject *given_globals,
if
(
builtins_import
==
NULL
)
{
builtins_import
=
_PyDict_GetItemId
(
interp
->
builtins
,
&
PyId___import__
);
if
(
builtins_import
==
NULL
)
{
Py_FatalError
(
"__import__ missing"
);
PyErr_SetString
(
PyExc_ImportError
,
"__import__ not found"
);
goto
error_with_unlock
;
}
}
Py_INCREF
(
builtins_import
);
...
...
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