summary refs log tree commit diff
diff options
context:
space:
mode:
authorAndrew Morgan <andrew@amorgan.xyz>2020-03-25 15:22:17 +0000
committerAndrew Morgan <andrew@amorgan.xyz>2020-03-25 15:23:46 +0000
commitcb76e53b7fa7e29f1d9e18ace367a289aa877dc5 (patch)
tree01daa7163bb4d1a32d87ecbb218475ad71a034aa
parentMove catchup of replication streams to worker. (#7024) (diff)
downloadsynapse-cb76e53b7fa7e29f1d9e18ace367a289aa877dc5.tar.xz
Only import sqlite3 by default if running mypy checks
-rw-r--r--synapse/storage/engines/sqlite.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/synapse/storage/engines/sqlite.py b/synapse/storage/engines/sqlite.py

index 2bfeefd54e..836c3aae17 100644 --- a/synapse/storage/engines/sqlite.py +++ b/synapse/storage/engines/sqlite.py
@@ -12,12 +12,16 @@ # 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 +from pip._internal.utils.typing import MYPY_CHECK_RUNNING + from synapse.storage.engines import BaseDatabaseEngine +if MYPY_CHECK_RUNNING: + import sqlite3 + class Sqlite3Engine(BaseDatabaseEngine[sqlite3.Connection]): def __init__(self, database_module, database_config):