From 50ac2197db987fd48d5aeab2ce7e54c3c03de175 Mon Sep 17 00:00:00 2001 From: tkrabel Date: Sun, 29 Oct 2023 10:29:59 +0100 Subject: [PATCH] black format --- rope/contrib/autoimport/sqlite.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/rope/contrib/autoimport/sqlite.py b/rope/contrib/autoimport/sqlite.py index a3e3085f8..7fda073cb 100644 --- a/rope/contrib/autoimport/sqlite.py +++ b/rope/contrib/autoimport/sqlite.py @@ -154,10 +154,16 @@ def create_database_connection( if memory or project is None or project.ropefolder is None: # Allows the in-memory db to be shared across threads # See https://www.sqlite.org/inmemorydb.html - project_hash = hash(project and project.ropefolder and project.ropefolder.real_path) - return sqlite3.connect(f"file:memdb{project_hash}:?mode=memory&cache=shared", uri=True) + project_hash = hash( + project and project.ropefolder and project.ropefolder.real_path + ) + return sqlite3.connect( + f"file:memdb{project_hash}:?mode=memory&cache=shared", uri=True + ) else: - return sqlite3.connect(str(Path(project.ropefolder.real_path) / "autoimport.db")) + return sqlite3.connect( + str(Path(project.ropefolder.real_path) / "autoimport.db") + ) def _setup_db(self): models.Metadata.create_table(self.connection)