Skip to content

Commit

Permalink
black format
Browse files Browse the repository at this point in the history
  • Loading branch information
tkrabel committed Oct 29, 2023
1 parent ba65f2e commit 50ac219
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions rope/contrib/autoimport/sqlite.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 50ac219

Please sign in to comment.