Skip to content

Commit 3a62cf3

Browse files
committed
chore(core): remove legacy conditions
1 parent d182d9e commit 3a62cf3

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

app/core/xray.py

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,8 @@ def __init__(
2020
):
2121
"""Initialize the XRay config."""
2222
if isinstance(config, str):
23-
try:
24-
# considering string as json
25-
config = commentjson.loads(config)
26-
except (json.JSONDecodeError, ValueError):
27-
# considering string as file path
28-
with open(config, "r") as file:
29-
config = commentjson.loads(file.read())
30-
31-
if isinstance(config, PosixPath):
32-
with open(config, "r") as file:
33-
config = commentjson.loads(file.read())
23+
# considering string as json
24+
config = commentjson.loads(config)
3425

3526
if isinstance(config, dict):
3627
config = deepcopy(config)

0 commit comments

Comments
 (0)