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
63b0cb2f
Kaydet (Commit)
63b0cb2f
authored
Eki 14, 2009
tarafından
Antoine Pitrou
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fix py3k warnings in bsddb
üst
868817ea
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
23 deletions
+16
-23
dbobj.py
Lib/bsddb/dbobj.py
+0
-0
dbshelve.py
Lib/bsddb/dbshelve.py
+2
-2
dbtables.py
Lib/bsddb/dbtables.py
+13
-20
dbutils.py
Lib/bsddb/dbutils.py
+1
-1
No files found.
Lib/bsddb/dbobj.py
Dosyayı görüntüle @
63b0cb2f
This diff is collapsed.
Click to expand it.
Lib/bsddb/dbshelve.py
Dosyayı görüntüle @
63b0cb2f
...
...
@@ -234,7 +234,7 @@ class DBShelf(MutableMapping):
# given nothing is passed to the extension module. That way
# an exception can be raised if set_get_returns_none is turned
# off.
data
=
apply
(
self
.
db
.
get
,
args
,
kw
)
data
=
self
.
db
.
get
(
*
args
,
**
kw
)
try
:
return
cPickle
.
loads
(
data
)
except
(
EOFError
,
TypeError
,
cPickle
.
UnpicklingError
):
...
...
@@ -303,7 +303,7 @@ class DBShelfCursor:
def
get
(
self
,
*
args
):
count
=
len
(
args
)
# a method overloading hack
method
=
getattr
(
self
,
'get_
%
d'
%
count
)
apply
(
method
,
args
)
method
(
*
args
)
def
get_1
(
self
,
flags
):
rec
=
self
.
dbc
.
get
(
flags
)
...
...
Lib/bsddb/dbtables.py
Dosyayı görüntüle @
63b0cb2f
...
...
@@ -398,7 +398,7 @@ class bsdTableDB :
# column names
newcolumnlist
=
copy
.
copy
(
oldcolumnlist
)
for
c
in
columns
:
if
not
oldcolumnhash
.
has_key
(
c
)
:
if
not
c
in
oldcolumnhash
:
newcolumnlist
.
append
(
c
)
# store the table's new extended column list
...
...
@@ -472,7 +472,7 @@ class bsdTableDB :
raise
TableDBError
,
"unknown table"
# check the validity of each column name
if
not
self
.
__tablecolumns
.
has_key
(
table
)
:
if
not
table
in
self
.
__tablecolumns
:
self
.
__load_column_info
(
table
)
for
column
in
rowdict
.
keys
()
:
if
not
self
.
__tablecolumns
[
table
]
.
count
(
column
):
...
...
@@ -540,7 +540,7 @@ class bsdTableDB :
# error
dataitem
=
None
dataitem
=
mappings
[
column
](
dataitem
)
if
dataitem
<>
None
:
if
dataitem
!=
None
:
self
.
db
.
put
(
_data_key
(
table
,
column
,
rowid
),
dataitem
,
txn
=
txn
)
...
...
@@ -615,7 +615,7 @@ class bsdTableDB :
argument and returning a boolean.
"""
try
:
if
not
self
.
__tablecolumns
.
has_key
(
table
)
:
if
not
table
in
self
.
__tablecolumns
:
self
.
__load_column_info
(
table
)
if
columns
is
None
:
columns
=
self
.
__tablecolumns
[
table
]
...
...
@@ -639,7 +639,7 @@ class bsdTableDB :
argument and returning a boolean.
"""
# check the validity of each column name
if
not
self
.
__tablecolumns
.
has_key
(
table
)
:
if
not
table
in
self
.
__tablecolumns
:
self
.
__load_column_info
(
table
)
if
columns
is
None
:
columns
=
self
.
tablecolumns
[
table
]
...
...
@@ -709,28 +709,24 @@ class bsdTableDB :
# extract the rowid from the key
rowid
=
key
[
-
_rowid_str_len
:]
if
not
r
ejected_rowids
.
has_key
(
rowid
)
:
if
not
r
owid
in
rejected_rowids
:
# if no condition was specified or the condition
# succeeds, add row to our match list.
if
not
condition
or
condition
(
data
):
if
not
matching_rowids
.
has_key
(
rowid
)
:
if
not
rowid
in
matching_rowids
:
matching_rowids
[
rowid
]
=
{}
if
savethiscolumndata
:
matching_rowids
[
rowid
][
column
]
=
data
else
:
if
matching_rowids
.
has_key
(
rowid
)
:
if
rowid
in
matching_rowids
:
del
matching_rowids
[
rowid
]
rejected_rowids
[
rowid
]
=
rowid
key
,
data
=
cur
.
next
()
except
db
.
DBError
,
dberror
:
if
sys
.
version_info
[
0
]
<
3
:
if
dberror
[
0
]
!=
db
.
DB_NOTFOUND
:
raise
else
:
if
dberror
.
args
[
0
]
!=
db
.
DB_NOTFOUND
:
raise
if
dberror
.
args
[
0
]
!=
db
.
DB_NOTFOUND
:
raise
continue
cur
.
close
()
...
...
@@ -743,7 +739,7 @@ class bsdTableDB :
if
len
(
columns
)
>
0
:
for
rowid
,
rowdata
in
matching_rowids
.
items
():
for
column
in
columns
:
if
rowdata
.
has_key
(
column
)
:
if
column
in
rowdata
:
continue
try
:
rowdata
[
column
]
=
self
.
db
.
get
(
...
...
@@ -815,13 +811,10 @@ class bsdTableDB :
txn
.
commit
()
txn
=
None
if
self
.
__tablecolumns
.
has_key
(
table
)
:
if
table
in
self
.
__tablecolumns
:
del
self
.
__tablecolumns
[
table
]
except
db
.
DBError
,
dberror
:
if
txn
:
txn
.
abort
()
if
sys
.
version_info
[
0
]
<
3
:
raise
TableDBError
,
dberror
[
1
]
else
:
raise
TableDBError
,
dberror
.
args
[
1
]
raise
TableDBError
(
dberror
.
args
[
1
])
Lib/bsddb/dbutils.py
Dosyayı görüntüle @
63b0cb2f
...
...
@@ -61,7 +61,7 @@ def DeadlockWrap(function, *_args, **_kwargs):
"""
sleeptime
=
_deadlock_MinSleepTime
max_retries
=
_kwargs
.
get
(
'max_retries'
,
-
1
)
if
_kwargs
.
has_key
(
'max_retries'
)
:
if
'max_retries'
in
_kwargs
:
del
_kwargs
[
'max_retries'
]
while
True
:
try
:
...
...
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