Skip to content

Commit

Permalink
Compatibility wrt typing annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
fbinz committed Jun 3, 2024
1 parent 777f65e commit a14cd0e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion django_scrubber/services/validator.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import re
from typing import Union

from django.apps import apps

Expand All @@ -11,7 +12,7 @@ class ScrubberValidatorService:
"""

@staticmethod
def check_pattern(pattern: str | re.Pattern, value):
def check_pattern(pattern: Union[str, re.Pattern], value):
if isinstance(pattern, str):
return pattern == value
elif isinstance(pattern, re.Pattern):
Expand Down

0 comments on commit a14cd0e

Please sign in to comment.