summaryrefslogtreecommitdiff
path: root/sys/lib/python/bsddb/test/test_1413192.py
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@localhost>2011-05-03 11:25:13 +0000
committercinap_lenrek <cinap_lenrek@localhost>2011-05-03 11:25:13 +0000
commit458120dd40db6b4df55a4e96b650e16798ef06a0 (patch)
tree8f82685be24fef97e715c6f5ca4c68d34d5074ee /sys/lib/python/bsddb/test/test_1413192.py
parent3a742c699f6806c1145aea5149bf15de15a0afd7 (diff)
add hg and python
Diffstat (limited to 'sys/lib/python/bsddb/test/test_1413192.py')
-rw-r--r--sys/lib/python/bsddb/test/test_1413192.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/sys/lib/python/bsddb/test/test_1413192.py b/sys/lib/python/bsddb/test/test_1413192.py
new file mode 100644
index 000000000..436f40786
--- /dev/null
+++ b/sys/lib/python/bsddb/test/test_1413192.py
@@ -0,0 +1,21 @@
+
+# http://python.org/sf/1413192
+#
+# This test relies on the variable names, see the bug report for details.
+# The problem was that the env was deallocated prior to the txn.
+
+try:
+ # For Pythons w/distutils and add-on pybsddb
+ from bsddb3 import db
+except ImportError:
+ # For Python >= 2.3 builtin bsddb distribution
+ from bsddb import db
+
+env_name = '.'
+
+env = db.DBEnv()
+env.open(env_name, db.DB_CREATE | db.DB_INIT_TXN | db.DB_INIT_MPOOL)
+the_txn = env.txn_begin()
+
+map = db.DB(env)
+map.open('xxx.db', "p", db.DB_HASH, db.DB_CREATE, 0666, txn=the_txn)