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
b5cf301b
Kaydet (Commit)
b5cf301b
authored
Eyl 25, 2008
tarafından
Amaury Forgeot d'Arc
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
#3929: dbm.open() would try to raise a tuple. This does not work anymore with python 3.0.
Reviewed by Georg Brandl.
üst
7de5f299
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
4 deletions
+11
-4
__init__.py
Lib/dbm/__init__.py
+4
-4
test_dbm.py
Lib/test/test_dbm.py
+3
-0
NEWS
Misc/NEWS
+4
-0
No files found.
Lib/dbm/__init__.py
Dosyayı görüntüle @
b5cf301b
...
...
@@ -76,13 +76,13 @@ def open(file, flag = 'r', mode = 0o666):
# file doesn't exist and the new flag was used so use default type
mod
=
_defaultmod
else
:
raise
error
(
"need 'c' or 'n' flag to open new db"
)
raise
error
[
0
]
(
"need 'c' or 'n' flag to open new db"
)
elif
result
==
""
:
# db type cannot be determined
raise
error
(
"db type could not be determined"
)
raise
error
[
0
]
(
"db type could not be determined"
)
elif
result
not
in
_modules
:
raise
error
(
"db type is {0}, but the module is not "
"available"
.
format
(
result
))
raise
error
[
0
]
(
"db type is {0}, but the module is not "
"available"
.
format
(
result
))
else
:
mod
=
_modules
[
result
]
return
mod
.
open
(
file
,
flag
,
mode
)
...
...
Lib/test/test_dbm.py
Dosyayı görüntüle @
b5cf301b
...
...
@@ -57,6 +57,9 @@ class AnyDBMTestCase(unittest.TestCase):
def
test_error
(
self
):
self
.
assert_
(
issubclass
(
self
.
module
.
error
,
IOError
))
def
test_anydbm_not_existing
(
self
):
self
.
assertRaises
(
dbm
.
error
,
dbm
.
open
,
_fname
)
def
test_anydbm_creation
(
self
):
f
=
dbm
.
open
(
_fname
,
'c'
)
self
.
assertEqual
(
list
(
f
.
keys
()),
[])
...
...
Misc/NEWS
Dosyayı görüntüle @
b5cf301b
...
...
@@ -20,6 +20,10 @@ Core and Builtins
Library
-------
- Issue #3929: When the database cannot be opened, dbm.open() would incorrectly
raise a TypeError: "'tuple' object is not callable" instead of the expected
dbm.error.
- Bug #3884: Make the turtle module toplevel again.
- Issue #3547: Fixed ctypes structures bitfields of varying integer
...
...
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