Skip to content

Commit b9e0c87

Browse files
committed
fix: move keywords replace up
1 parent 85fa852 commit b9e0c87

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

roboflow/core/project.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -554,13 +554,14 @@ def _annotation_params(self, annotation_path):
554554
def _parse_upload_error(self, error: rfapi.UploadError) -> str:
555555
dict_part = str(error).split(": ", 2)[2]
556556
if re.search(r"'\w+':", dict_part):
557+
dict_part = dict_part.replace("True", "true")
558+
dict_part = dict_part.replace("False", "false")
559+
dict_part = dict_part.replace("None", "null")
557560
temp_str = dict_part.replace(r"\'", "<PLACEHOLDER>")
558561
temp_str = temp_str.replace('"', r"\"")
559562
temp_str = temp_str.replace("'", '"')
560563
dict_part = temp_str.replace("<PLACEHOLDER>", "'")
561-
dict_part = dict_part.replace("True", "true")
562-
dict_part = dict_part.replace("False", "false")
563-
dict_part = dict_part.replace("None", "null")
564+
564565
parsed_dict: dict = json.loads(dict_part)
565566
message = parsed_dict.get("message")
566567
return message or str(parsed_dict)

0 commit comments

Comments
 (0)