Skip to content

Commit 201b074

Browse files
committed
Try to import trustore and catch the exception if it fails. This allows py-client to be loaded bundled in plugin on QGIS with python<3.10
1 parent 6f4b26f commit 201b074

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

mergin/client.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
import platform
1212
from datetime import datetime, timezone
1313
import dateutil.parser
14-
import truststore
1514
from enum import Enum, auto
1615
import re
1716
import typing
@@ -71,7 +70,12 @@
7170
)
7271
from .version import __version__
7372

74-
truststore.inject_into_ssl()
73+
try:
74+
import truststore
75+
76+
truststore.inject_into_ssl()
77+
except ImportError:
78+
pass
7579

7680
json_headers = {"Content-Type": "application/json"}
7781

0 commit comments

Comments
 (0)