mirror of
https://github.com/onyx-and-iris/obsws-python.git
synced 2024-11-22 04:40:53 +00:00
Merge pull request #17 from kamalmostafa/no-tomllib
allow use without installing tomllib
This commit is contained in:
commit
335fa42948
@ -5,11 +5,6 @@ import logging
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from random import randint
|
from random import randint
|
||||||
|
|
||||||
try:
|
|
||||||
import tomllib
|
|
||||||
except ModuleNotFoundError:
|
|
||||||
import tomli as tomllib
|
|
||||||
|
|
||||||
import websocket
|
import websocket
|
||||||
|
|
||||||
from .error import OBSSDKError
|
from .error import OBSSDKError
|
||||||
@ -37,6 +32,10 @@ class ObsClient:
|
|||||||
self.server_hello = json.loads(self.ws.recv())
|
self.server_hello = json.loads(self.ws.recv())
|
||||||
|
|
||||||
def _conn_from_toml(self) -> dict:
|
def _conn_from_toml(self) -> dict:
|
||||||
|
try:
|
||||||
|
import tomllib
|
||||||
|
except ModuleNotFoundError:
|
||||||
|
import tomli as tomllib
|
||||||
conn = {}
|
conn = {}
|
||||||
filepath = Path.cwd() / "config.toml"
|
filepath = Path.cwd() / "config.toml"
|
||||||
if filepath.exists():
|
if filepath.exists():
|
||||||
|
Loading…
Reference in New Issue
Block a user