summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Bostic <keith.bostic@mongodb.com>2015-04-03 19:08:04 -0400
committerKeith Bostic <keith.bostic@mongodb.com>2015-04-03 19:08:04 -0400
commit169fe762eabd02427dde21c0dc4a8888823e88d4 (patch)
treef2d76f055065903bbec14149e953886b0d2c81f8
parent8227a3342a1dedbf783e982715f783b7dec07a7d (diff)
parent149a66b6383e63050a0c5f6eef3d82262e2ba3ee (diff)
downloadmongo-169fe762eabd02427dde21c0dc4a8888823e88d4.tar.gz
Merge pull request #1847 from pgunn/master
Add shebang, make db dir if does not exist
-rwxr-xr-xexamples/python/ex_access.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/examples/python/ex_access.py b/examples/python/ex_access.py
index 7789f932d19..6283f5051b8 100755
--- a/examples/python/ex_access.py
+++ b/examples/python/ex_access.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
# Public Domain 2014-2015 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
@@ -24,9 +25,13 @@
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
+import os
from wiredtiger import wiredtiger_open
# Connect to the database and open a session
+if not os.path.exists('WT_TEST'):
+ os.makedirs('WT_TEST')
+
conn = wiredtiger_open('WT_TEST', 'create')
session = conn.open_session()