Skip to content

Commit

Permalink
Fix error when db location does not already exist
Browse files Browse the repository at this point in the history
  • Loading branch information
takluyver committed Apr 8, 2016
1 parent 02f3a92 commit 03929ef
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions pickleshare.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
from __future__ import print_function


__version__ = "0.7"
__version__ = "0.7.1"

try:
from pathlib import Path
Expand All @@ -62,7 +62,8 @@ class PickleShareDB(collections.MutableMapping):
""" The main 'connection' object for PickleShare database """
def __init__(self,root):
""" Return a db object that will manage the specied directory"""
self.root = Path(os.path.expanduser(str(root))).resolve()
root = os.path.abspath(os.path.expanduser(str(root)))
self.root = Path(root)
if not self.root.is_dir():
self.root.mkdir(parents=True)
# cache has { 'key' : (obj, orig_mod_time) }
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
(non-mission-critical) situations where tiny code size trumps the
advanced features of a "real" object database.
Installation guide: pip install path pickleshare
Installation guide: pip install pickleshare
""",
classifiers=[
'License :: OSI Approved :: MIT License',
Expand Down

0 comments on commit 03929ef

Please sign in to comment.