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
57a4e909
Commit
57a4e909
authored
Sep 18, 2000
by
Fred Drake
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix up the cleanup of the temporary DB so it works for BSD DB's
compatibility layer as well as "classic" ndbm.
parent
a12adfe4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
4 deletions
+12
-4
Lib/test/test_dbm.py
Lib/test/test_dbm.py
+12
-4
No files found.
Lib/test/test_dbm.py
View file @
57a4e909
...
...
@@ -6,7 +6,7 @@ import dbm
from
dbm
import
error
from
test_support
import
verbose
filename
=
'/tmp/delete_me'
filename
=
'/tmp/delete_me'
d
=
dbm
.
open
(
filename
,
'c'
)
d
[
'a'
]
=
'b'
...
...
@@ -15,7 +15,7 @@ d.keys()
if
d
.
has_key
(
'a'
):
if
verbose
:
print
'Test dbm keys: '
,
d
.
keys
()
d
.
close
()
d
=
dbm
.
open
(
filename
,
'r'
)
d
.
close
()
...
...
@@ -28,7 +28,15 @@ d.close()
try
:
import
os
os
.
unlink
(
filename
+
'.dir'
)
os
.
unlink
(
filename
+
'.pag'
)
if
dbm
.
library
==
"ndbm"
:
# classic dbm
os
.
unlink
(
filename
+
'.dir'
)
os
.
unlink
(
filename
+
'.pag'
)
elif
dbm
.
library
==
"BSD db"
:
# BSD DB's compatibility layer
os
.
unlink
(
filename
+
'.db'
)
else
:
# GNU gdbm compatibility layer
os
.
unlink
(
filename
)
except
:
pass
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