summary refs log tree commit diff
path: root/synapse/storage
diff options
context:
space:
mode:
authorDavid Vo <david@vovo.id.au>2020-03-27 12:26:55 +1100
committerAndrew Morgan <andrew@amorgan.xyz>2020-03-31 11:27:17 +0100
commit5bd2b275254bcbf001bee20d821c0ef567b9587f (patch)
treea0159125dd5e18079477961eba80481fa7b65497 /synapse/storage
parentFix another instance (diff)
downloadsynapse-5bd2b275254bcbf001bee20d821c0ef567b9587f.tar.xz
Only import sqlite3 when type checking
Fixes: #7127
Signed-off-by: David Vo <david@vovo.id.au>
Diffstat (limited to 'synapse/storage')
-rw-r--r--synapse/storage/engines/sqlite.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/synapse/storage/engines/sqlite.py b/synapse/storage/engines/sqlite.py
index 2bfeefd54e..3bc2e8b986 100644
--- a/synapse/storage/engines/sqlite.py
+++ b/synapse/storage/engines/sqlite.py
@@ -12,14 +12,17 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
-import sqlite3
 import struct
 import threading
+import typing
 
 from synapse.storage.engines import BaseDatabaseEngine
 
+if typing.TYPE_CHECKING:
+    import sqlite3  # noqa: F401
 
-class Sqlite3Engine(BaseDatabaseEngine[sqlite3.Connection]):
+
+class Sqlite3Engine(BaseDatabaseEngine["sqlite3.Connection"]):
     def __init__(self, database_module, database_config):
         super().__init__(database_module, database_config)