Skip to content

Commit

Permalink
try
Browse files Browse the repository at this point in the history
  • Loading branch information
ofek committed Nov 14, 2021
1 parent 60fd31e commit 6a98266
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions tomli/_re.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@

from tomli._types import ParseFloat

# Remove when support for Python 3.6 is dropped and use `re.Pattern` directly
# https://github.com/python/cpython/blob/3.6/Lib/re.py#L283
_re_pattern_type = getattr(re, "Pattern", None) or getattr(re, "_pattern_type", None)


# E.g.
# - 00:32:00.999999
Expand All @@ -17,7 +13,7 @@


class _LazyPatternCompiler:
def __getattr__(self, name: str) -> _re_pattern_type:
def __getattr__(self, name: str) -> "re.Pattern":
if name == "datetime":
pattern = re.compile(
fr"""
Expand Down Expand Up @@ -58,7 +54,6 @@ def __getattr__(self, name: str) -> _re_pattern_type:
setattr(self, name, pattern)
return pattern


Patterns = _LazyPatternCompiler()


Expand Down

0 comments on commit 6a98266

Please sign in to comment.