Skip to content

Commit b213c58

Browse files
committed
clean up the comparator
1 parent 7a311e7 commit b213c58

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

codeflash/verification/comparator.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1+
import ast
12
import datetime
23
import decimal
34
import enum
45
import math
56
import re
67
import types
78
from typing import Any
8-
import ast
9+
910
import sentry_sdk
1011

1112
from codeflash.cli_cmds.console import logger
@@ -61,6 +62,7 @@ def comparator(orig: Any, new: Any) -> bool:
6162
bool,
6263
complex,
6364
type(None),
65+
type(Ellipsis),
6466
decimal.Decimal,
6567
set,
6668
bytes,
@@ -77,8 +79,6 @@ def comparator(orig: Any, new: Any) -> bool:
7779
return True
7880
return math.isclose(orig, new)
7981
if isinstance(orig, BaseException):
80-
# if str(orig) != str(new):
81-
# return False
8282
# compare the attributes of the two exception objects to determine if they are equivalent.
8383
orig_dict = {k: v for k, v in orig.__dict__.items() if not k.startswith("_")}
8484
new_dict = {k: v for k, v in new.__dict__.items() if not k.startswith("_")}
@@ -205,8 +205,6 @@ def comparator(orig: Any, new: Any) -> bool:
205205
return new == orig
206206
if str(type(orig)) == "<class 'object'>":
207207
return True
208-
if orig is Ellipsis and new is Ellipsis:
209-
return True
210208
# TODO : Add other types here
211209
logger.warning(f"Unknown comparator input type: {type(orig)}")
212210
return False

0 commit comments

Comments
 (0)