diff --git a/osxphotos/__init__.py b/osxphotos/__init__.py index c0e6551c..79f4d7cc 100644 --- a/osxphotos/__init__.py +++ b/osxphotos/__init__.py @@ -269,7 +269,7 @@ class PhotosDB: # got a library path as argument if dbfile: # shouldn't pass via both *args and dbfile= - raise ValueError( + raise TypeError( f"photos database path must be specified as argument or named parameter dbfile but not both: args: {args}, dbfile: {dbfile}", args, dbfile, @@ -277,7 +277,7 @@ class PhotosDB: elif len(args) == 1: dbfile = args[0] else: - raise ValueError( + raise TypeError( f"__init__ takes only a single argument (photos database path): {args}", args, ) @@ -285,7 +285,7 @@ class PhotosDB: # no args and dbfile not passed, try to get last opened library library_path = get_last_library_path() if not library_path: - raise ValueError("could not get library path") + raise FileNotFoundError("could not get library path") dbfile = os.path.join(library_path, "database/photos.db") if os.path.isdir(dbfile): @@ -294,7 +294,7 @@ class PhotosDB: # if get here, should have a dbfile path; make sure it exists if not _check_file_exists(dbfile): - raise ValueError(f"dbfile {dbfile} does not exist", dbfile) + raise FileNotFoundError(f"dbfile {dbfile} does not exist", dbfile) logging.debug(f"dbfile = {dbfile}") @@ -1476,7 +1476,7 @@ class PhotoInfo: # TODO: find better way to do *args # maybe dest, *filename? - + # check arguments and get destination path and filename (if provided) dest = None # destination path filename = None # photo filename diff --git a/osxphotos/_version.py b/osxphotos/_version.py index 867f43a1..cc8509a7 100644 --- a/osxphotos/_version.py +++ b/osxphotos/_version.py @@ -1,4 +1,4 @@ """ version info """ -__version__ = "0.15.0" +__version__ = "0.15.01" diff --git a/tests/test_catalina_10_15_1.py b/tests/test_catalina_10_15_1.py index dd5ddea0..f6d69ef1 100644 --- a/tests/test_catalina_10_15_1.py +++ b/tests/test_catalina_10_15_1.py @@ -58,7 +58,7 @@ UUID_DICT = { } -def test_init(): +def test_init1(): # test named argument import osxphotos