Skip to content

Commit

Permalink
fix molton errors
Browse files Browse the repository at this point in the history
  • Loading branch information
mabdinur committed Nov 15, 2024
1 parent 39e924b commit 22f0874
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion ddtrace/settings/_otel_remapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,17 @@

if sys.version_info < (3, 8):
from typing_extensions import Literal
from typing_extensions import Optional

try:
from typing_extensions import Optional
except ImportError:
# hack to support the Optional type for python3.7 + typing_extensions<4.0 (ex: molton)
from typing import Union

class Optional:
def __class_getitem__(self, item):
return Union[item, type(None)]

else:
from typing import Literal
from typing import Optional
Expand Down

0 comments on commit 22f0874

Please sign in to comment.