From 9690c20cbc5420bfee0cbe3ceeb925df3b9ecbc4 Mon Sep 17 00:00:00 2001 From: Doug Blank Date: Sat, 30 Apr 2016 10:05:17 -0400 Subject: [PATCH] InMemoryDB: provide None for dbname --- gramps/gen/db/generic.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/gramps/gen/db/generic.py b/gramps/gen/db/generic.py index 9030e5594..3f2de01f9 100644 --- a/gramps/gen/db/generic.py +++ b/gramps/gen/db/generic.py @@ -2025,13 +2025,14 @@ class DbGeneric(DbWriteBase, DbReadBase, UpdateCallback, Callback): """ In DbGeneric, the database is in a text file at the path """ - filepath = os.path.join(self._directory, "name.txt") - try: - with open(filepath, "r") as name_file: - name = name_file.readline().strip() - except (OSError, IOError) as msg: - LOG.error(str(msg)) - name = None + name = None + if self._directory: + filepath = os.path.join(self._directory, "name.txt") + try: + with open(filepath, "r") as name_file: + name = name_file.readline().strip() + except (OSError, IOError) as msg: + LOG.error(str(msg)) return name def _order_by_person_key(self, person):