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
280e9f7c
Kaydet (Commit)
280e9f7c
authored
May 18, 2012
tarafından
Petri Lehtinen
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
#14798: pyclbr now raises ImportError instead of KeyError for missing packages
üst
491ef97f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
0 deletions
+12
-0
pyclbr.py
Lib/pyclbr.py
+2
-0
test_pyclbr.py
Lib/test/test_pyclbr.py
+5
-0
ACKS
Misc/ACKS
+1
-0
NEWS
Misc/NEWS
+4
-0
No files found.
Lib/pyclbr.py
Dosyayı görüntüle @
280e9f7c
...
...
@@ -128,6 +128,8 @@ def _readmodule(module, path, inpackage=None):
parent
=
_readmodule
(
package
,
path
,
inpackage
)
if
inpackage
is
not
None
:
package
=
"
%
s.
%
s"
%
(
inpackage
,
package
)
if
not
'__path__'
in
parent
:
raise
ImportError
(
'No package named {}'
.
format
(
package
))
return
_readmodule
(
submodule
,
parent
[
'__path__'
],
package
)
# Search the path for the module
...
...
Lib/test/test_pyclbr.py
Dosyayı görüntüle @
280e9f7c
...
...
@@ -188,6 +188,11 @@ class PyclbrTest(TestCase):
cm
(
'email.parser'
)
cm
(
'test.test_pyclbr'
)
def
test_issue_14798
(
self
):
# test ImportError is raised when the first part of a dotted name is
# not a package
self
.
assertRaises
(
ImportError
,
pyclbr
.
readmodule_ex
,
'asyncore.foo'
)
def
test_main
():
run_unittest
(
PyclbrTest
)
...
...
Misc/ACKS
Dosyayı görüntüle @
280e9f7c
...
...
@@ -297,6 +297,7 @@ Lars Marius Garshol
Dan Gass
Andrew Gaul
Stephen M. Gava
Xavier de Gaye
Harry Henry Gebel
Marius Gedminas
Thomas Gellekum
...
...
Misc/NEWS
Dosyayı görüntüle @
280e9f7c
...
...
@@ -60,6 +60,10 @@ Core and Builtins
Library
-------
-
Issue
#
14798
:
Fix
the
functions
in
pyclbr
to
raise
an
ImportError
when
the
first
part
of
a
dotted
name
is
not
a
package
.
Patch
by
Xavier
de
Gaye
.
-
Issue
#
14832
:
fixed
the
order
of
the
argument
references
in
the
error
message
produced
by
unittest
's assertItemsEqual.
...
...
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