Skip to content

Commit

Permalink
Apply the fix from scrapinghub#1045 (comment)
Browse files Browse the repository at this point in the history
  • Loading branch information
asaggi-supportlogic committed Jun 30, 2022
1 parent 0ed979e commit f58d836
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dateparser/languages/locale.py
Expand Up @@ -169,7 +169,7 @@ def _generate_relative_translations(self, normalize=False):
if normalize:
value = list(map(normalize_unicode, value))
pattern = '|'.join(sorted(value, key=len, reverse=True))
pattern = DIGIT_GROUP_PATTERN.sub(r'?P<n>\d+', pattern)
pattern = pattern.replace(r'\d+', r'?P<n>\d+')
pattern = re.compile(r'^(?:{})$'.format(pattern), re.UNICODE | re.IGNORECASE)
relative_dictionary[pattern] = key
return relative_dictionary
Expand Down
3 changes: 1 addition & 2 deletions setup.py
Expand Up @@ -26,8 +26,7 @@
install_requires=[
'python-dateutil',
'pytz',
# https://bitbucket.org/mrabarnett/mrab-regex/issues/314/import-error-no-module-named
'regex !=2019.02.19,!=2021.8.27,<2022.3.15',
'regex >=2022.3.15',
'tzlocal',
],
entry_points={
Expand Down

0 comments on commit f58d836

Please sign in to comment.