Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
d6013d78
Commit
d6013d78
authored
Oct 13, 2007
by
Gregory P. Smith
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix an uncollectable reference leak in bsddb.db.DBShelf.append
parent
bfaa752c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
2 deletions
+19
-2
Lib/bsddb/dbshelve.py
Lib/bsddb/dbshelve.py
+19
-2
No files found.
Lib/bsddb/dbshelve.py
View file @
d6013d78
...
...
@@ -93,6 +93,7 @@ class DBShelf(DictMixin):
"""
def
__init__
(
self
,
dbenv
=
None
):
self
.
db
=
db
.
DB
(
dbenv
)
self
.
_closed
=
True
if
HIGHEST_PROTOCOL
:
self
.
protocol
=
HIGHEST_PROTOCOL
else
:
...
...
@@ -138,6 +139,23 @@ class DBShelf(DictMixin):
return
self
.
db
.
keys
()
def
open
(
self
,
*
args
,
**
kwargs
):
self
.
db
.
open
(
*
args
,
**
kwargs
)
self
.
_closed
=
False
def
close
(
self
,
*
args
,
**
kwargs
):
self
.
db
.
close
(
*
args
,
**
kwargs
)
self
.
_closed
=
True
def
__repr__
(
self
):
if
self
.
_closed
:
return
'<DBShelf @ 0x%x - closed>'
%
(
id
(
self
))
else
:
return
repr
(
dict
(
self
.
iteritems
()))
def
items
(
self
,
txn
=
None
):
if
txn
!=
None
:
items
=
self
.
db
.
items
(
txn
)
...
...
@@ -166,8 +184,7 @@ class DBShelf(DictMixin):
def
append
(
self
,
value
,
txn
=
None
):
if
self
.
get_type
()
==
db
.
DB_RECNO
:
self
.
append
=
self
.
__append
return
self
.
append
(
value
,
txn
=
txn
)
return
self
.
__append
(
value
,
txn
=
txn
)
raise
DBShelveError
,
"append() only supported when dbshelve opened with filetype=dbshelve.db.DB_RECNO"
...
...
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