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
161586c8
Kaydet (Commit)
161586c8
authored
Eyl 06, 2007
tarafından
Gregory P. Smith
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Apply the fix from Issue1112 to make this test more robust and keep
windows happy.
üst
52bc1f1d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
9 deletions
+22
-9
test_1413192.py
Lib/bsddb/test/test_1413192.py
+22
-9
No files found.
Lib/bsddb/test/test_1413192.py
Dosyayı görüntüle @
161586c8
# http://python.org/sf/1413192
# http://bugs.python.org/issue1413192
#
#
This test relies on the variable names, s
ee the bug report for details.
#
S
ee the bug report for details.
# The problem was that the env was deallocated prior to the txn.
import
shutil
...
...
@@ -15,14 +14,28 @@ except ImportError:
env_name
=
tempfile
.
mkdtemp
()
env
=
db
.
DBEnv
()
env
.
open
(
env_name
,
db
.
DB_CREATE
|
db
.
DB_INIT_TXN
|
db
.
DB_INIT_MPOOL
)
the_txn
=
env
.
txn_begin
()
# Wrap test operation in a class so we can control destruction rather than
# waiting for the controlling Python executable to exit
class
Context
:
def
__init__
(
self
):
self
.
env
=
db
.
DBEnv
()
self
.
env
.
open
(
env_name
,
db
.
DB_CREATE
|
db
.
DB_INIT_TXN
|
db
.
DB_INIT_MPOOL
)
self
.
the_txn
=
self
.
env
.
txn_begin
()
self
.
map
=
db
.
DB
(
self
.
env
)
self
.
map
.
open
(
'xxx.db'
,
"p"
,
db
.
DB_HASH
,
db
.
DB_CREATE
,
0666
,
txn
=
self
.
the_txn
)
del
self
.
env
del
self
.
the_txn
map
=
db
.
DB
(
env
)
map
.
open
(
'xxx.db'
,
"p"
,
db
.
DB_HASH
,
db
.
DB_CREATE
,
0666
,
txn
=
the_txn
)
context
=
Context
(
)
del
context
# try not to leave a turd
(won't help Windows since files are still open)
# try not to leave a turd
try
:
shutil
.
rmtree
(
env_name
)
except
EnvironmentError
:
...
...
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