mirror of
https://github.com/element-hq/synapse.git
synced 2024-12-23 05:00:24 +03:00
Only import sqlite3 by default if running mypy checks
This commit is contained in:
parent
4cff617df1
commit
cb76e53b7f
1 changed files with 5 additions and 1 deletions
|
@ -12,12 +12,16 @@
|
||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
import sqlite3
|
|
||||||
import struct
|
import struct
|
||||||
import threading
|
import threading
|
||||||
|
|
||||||
|
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
||||||
|
|
||||||
from synapse.storage.engines import BaseDatabaseEngine
|
from synapse.storage.engines import BaseDatabaseEngine
|
||||||
|
|
||||||
|
if MYPY_CHECK_RUNNING:
|
||||||
|
import sqlite3
|
||||||
|
|
||||||
|
|
||||||
class Sqlite3Engine(BaseDatabaseEngine[sqlite3.Connection]):
|
class Sqlite3Engine(BaseDatabaseEngine[sqlite3.Connection]):
|
||||||
def __init__(self, database_module, database_config):
|
def __init__(self, database_module, database_config):
|
||||||
|
|
Loading…
Reference in a new issue