Skip to content

Commit

Permalink
Use tdjson.dll only on Windows.
Browse files Browse the repository at this point in the history
  • Loading branch information
levlam committed Dec 10, 2023
1 parent c257615 commit 1a50ec4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions example/python/tdjson_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,12 @@
import sys

# load shared library
tdjson_path = find_library('tdjson') or os.path.join(os.path.dirname(__file__), 'tdjson.dll')
tdjson_path = find_library('tdjson')
if tdjson_path is None:
sys.exit("Can't find 'tdjson' library")
if os.name == 'nt':
tdjson_path = os.path.join(os.path.dirname(__file__), 'tdjson.dll')
else:
sys.exit("Can't find 'tdjson' library")
tdjson = CDLL(tdjson_path)

# load TDLib functions from shared library
Expand Down

0 comments on commit 1a50ec4

Please sign in to comment.