Skip to content

Commit

Permalink
Fix deprecation warnings. Refs #84
Browse files Browse the repository at this point in the history
  • Loading branch information
koenedaele committed Apr 15, 2021
1 parent 6d8d454 commit f5af2ae
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion language_tags/tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def search(description, all=False):
"""
Gets a list of :class:`language_tags.Subtag.Subtag` objects where the description matches.
:param description: a string or compiled regular expression. For example: ``search(re.compile('\d{4}'))`` if the
:param description: a string or compiled regular expression. For example: ``search(re.compile(r'\d{4}'))`` if the
description of the returned subtag must contain four contiguous numerical digits.
:type description: str or RegExp
:param all: If set on True grandfathered and redundant tags will be included in the return
Expand Down
4 changes: 2 additions & 2 deletions tests/test_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def test_search_exact_match(self):
self.assertEqual(subtags[0].format, 'prs')

def test_search_regexp(self):
subtags = tags.search(re.compile('\d{4}'))
subtags = tags.search(re.compile(r/'\d{4}'))
self.assertGreater(len(subtags), 0)

def test_type(self):
Expand Down Expand Up @@ -99,7 +99,7 @@ def test_languages(self):
self.assertIn('\'en\' is not a macrolanguage.', context.exception.args)

def test_date(self):
self.assertIsNotNone(re.compile('\d{4}\-\d{2}\-\d{2}').search(tags.date()))
self.assertIsNotNone(re.compile(r'\d{4}\-\d{2}\-\d{2}').search(tags.date()))

def test_description(self):
description = tags.description('nl-BE')
Expand Down

0 comments on commit f5af2ae

Please sign in to comment.