Skip to content

Commit 946db6f

Browse files
committed
🚸 Handle json decode error
1 parent 2d250e6 commit 946db6f

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/xmake_python/xmake.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
import json
22
import os
3-
43
from dataclasses import dataclass
5-
from subprocess import run
64
from pathlib import Path
7-
from shlex import split, join
5+
from shlex import join, split
6+
from subprocess import run
87

9-
from .builder.wheel_tag import WheelTag
108
from ._logging import rich_print
9+
from .builder.wheel_tag import WheelTag
1110

1211

1312
@dataclass
@@ -106,7 +105,11 @@ def show(self):
106105
"--json",
107106
]
108107
output = self.check_output(cmd)
109-
targets = json.loads(output)
108+
targets = []
109+
try:
110+
targets = json.loads(output)
111+
except json.decoder.JSONDecodeError:
112+
print(f"{output}")
110113
kinds = []
111114
for target in targets:
112115
kind = 0

0 commit comments

Comments
 (0)