From 7e118dc4a368c280178bc0a548751398110cf490 Mon Sep 17 00:00:00 2001 From: Ali RajabNezhad Date: Mon, 29 Jan 2024 03:29:10 +0330 Subject: [PATCH] Fix an issue in `PantherDB.__new__()` --- pantherdb/__init__.py | 2 +- pantherdb/pantherdb.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pantherdb/__init__.py b/pantherdb/__init__.py index f9d41cc..6a80276 100644 --- a/pantherdb/__init__.py +++ b/pantherdb/__init__.py @@ -1,6 +1,6 @@ from pantherdb.pantherdb import * # noqa: F403 -__version__ = '1.3.5' +__version__ = '1.3.6' __all__ = ('__version__', 'PantherDB', 'PantherCollection', 'PantherDocument', 'PantherDBException') diff --git a/pantherdb/pantherdb.py b/pantherdb/pantherdb.py index 06a8826..22b1202 100644 --- a/pantherdb/pantherdb.py +++ b/pantherdb/pantherdb.py @@ -24,9 +24,9 @@ def __new__(cls, *args, **kwargs): return super().__new__(cls) if args: - db_name = args[0] + db_name = args[0] or cls.db_name elif 'db_name' in kwargs: - db_name = kwargs['db_name'] + db_name = kwargs['db_name'] or cls.db_name else: db_name = cls.db_name