Skip to content

Commit 155bb4a

Browse files
FIX: Don't error out when JSON doesn't end with empty line (#169)
* accept inputs without emptyline at the end * linter * Linting --------- Co-authored-by: Alexander Andreev <alexander.andreev@intel.com>
1 parent e76e463 commit 155bb4a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

sklbench/utils/common.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,11 @@ def read_output_from_command(command: str) -> Tuple[int, str, str]:
6666
stderr=sp.PIPE,
6767
encoding="utf-8",
6868
)
69-
return res.returncode, res.stdout[:-1], res.stderr[:-1]
69+
return (
70+
res.returncode,
71+
res.stdout.strip(),
72+
res.stderr.strip(),
73+
)
7074

7175

7276
def hash_from_json_repr(x: JsonTypesUnion, hash_limit: int = 5) -> str:
@@ -120,7 +124,7 @@ def flatten_list(input_list: List, ensure_type_homogeneity: bool = False) -> Lis
120124

121125

122126
def get_module_members(
123-
module_names_chain: Union[List, str]
127+
module_names_chain: Union[List, str],
124128
) -> Tuple[ModuleContentMap, ModuleContentMap]:
125129
def get_module_name(module_names_chain: List[str]) -> str:
126130
name = module_names_chain[0]

0 commit comments

Comments
 (0)