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
d464838e
Kaydet (Commit)
d464838e
authored
Agu 02, 2004
tarafından
Tim Peters
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Removed no-longer-needed convolutions to recover from damaged modules
getting left beyind in sys.modules.
üst
1cd70173
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
25 deletions
+0
-25
pty.py
Lib/pty.py
+0
-11
test___all__.py
Lib/test/test___all__.py
+0
-14
No files found.
Lib/pty.py
Dosyayı görüntüle @
d464838e
...
...
@@ -8,17 +8,6 @@
from
select
import
select
import
os
# Absurd: import termios and then delete it. This is to force an attempt
# to import pty to raise an ImportError on platforms that lack termios.
# Without this explicit import of termios here, some other module may
# import tty first, which in turn imports termios and dies with an
# ImportError then. But since tty *does* exist across platforms, that
# leaves a damaged module object for tty in sys.modules, and the import
# of tty here then appears to work despite that the tty imported is junk.
import
termios
del
termios
import
tty
__all__
=
[
"openpty"
,
"fork"
,
"spawn"
]
...
...
Lib/test/test___all__.py
Dosyayı görüntüle @
d464838e
...
...
@@ -21,20 +21,6 @@ class AllTest(unittest.TestCase):
except
ImportError
:
# Silent fail here seems the best route since some modules
# may not be available in all environments.
# Since an ImportError may leave a partial module object in
# sys.modules, get rid of that first. Here's what happens if
# you don't: importing pty fails on Windows because pty tries to
# import FCNTL, which doesn't exist. That raises an ImportError,
# caught here. It also leaves a partial pty module in sys.modules.
# So when test_pty is called later, the import of pty succeeds,
# but shouldn't. As a result, test_pty crashes with an
# AttributeError instead of an ImportError, and regrtest interprets
# the latter as a test failure (ImportError is treated as "test
# skipped" -- which is what test_pty should say on Windows).
try
:
del
sys
.
modules
[
modname
]
except
KeyError
:
pass
return
verify
(
hasattr
(
sys
.
modules
[
modname
],
"__all__"
),
"
%
s has no __all__ attribute"
%
modname
)
...
...
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