mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-07-18 16:55:13 +03:00
https://github.com/alexander-akhmetov/python-telegram Python client for the Telegram's tdlib
27 lines
848 B
Diff
27 lines
848 B
Diff
diff --git a/telegram/tdjson.py b/telegram/tdjson.py
|
|
index 091145e..21c0361 100644
|
|
--- a/telegram/tdjson.py
|
|
+++ b/telegram/tdjson.py
|
|
@@ -2,6 +2,7 @@ import json
|
|
import logging
|
|
import platform
|
|
from ctypes import CDLL, CFUNCTYPE, c_int, c_char_p, c_double, c_void_p, c_longlong
|
|
+from ctypes.util import find_library
|
|
from typing import Any, Dict, Optional, Union
|
|
|
|
import pkg_resources
|
|
@@ -10,13 +11,7 @@ logger = logging.getLogger(__name__)
|
|
|
|
|
|
def _get_tdjson_lib_path() -> str:
|
|
- if platform.system().lower() == 'darwin':
|
|
- lib_name = 'darwin/libtdjson.dylib'
|
|
- else:
|
|
- lib_name = 'linux/libtdjson.so'
|
|
-
|
|
- return pkg_resources.resource_filename('telegram', f'lib/{lib_name}')
|
|
-
|
|
+ return find_library("tdjson")
|
|
|
|
class TDJson:
|
|
def __init__(self, library_path: Optional[str] = None, verbosity: int = 2) -> None:
|