Skip to content

Commit

Permalink
Merge pull request #57 from vEpiphyte/bug_deprecation_notice
Browse files Browse the repository at this point in the history
Fix DeprecationWarning issues in Python code.
  • Loading branch information
creekorful authored Feb 2, 2024
2 parents a9df7c6 + 40cada2 commit 7a570af
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion cpe/comp/cpecomp2_3.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ def _is_valid_part(self):
return super(CPEComponent2_3, self)._is_valid_part()

# Compilation of regular expression associated with value of part
part_pattern = "^(\{0}|\{1})$".format(self.WILDCARD_ONE,
part_pattern = r"^(\{0}|\{1})$".format(self.WILDCARD_ONE,
self.WILDCARD_MULTI)
part_rxc = re.compile(part_pattern)

Expand Down
2 changes: 1 addition & 1 deletion cpe/comp/cpecomp2_3_uri.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class CPEComponent2_3_URI(CPEComponent2_3):
# Patterns used to check the value of component
_PCT_ENCODED = "%21|%22|%23|%24|%25|%26|%27|%28|%29|%2a|%2b|%2c|%2f|%3a|%3b|%3c|%3d|%3e|%3f|%40|%5b|%5c|%5d|%5e|%60|%7b|%7c|%7d|%7e"
_SPEC_CHRS = "((%01)+|%02)"
_UNRESERVED = "[\w\-\.]"
_UNRESERVED = r"[\w\-\.]"

#: Separator of components of CPE name with URI style
SEPARATOR_COMP = ":"
Expand Down
4 changes: 2 additions & 2 deletions cpe/comp/cpecomp_simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ class CPEComponentSimple(CPEComponent):
###############

#: Pattern to check if a character is a alphanumeric or underscore
_ALPHANUM_PATTERN = "\w"
_ALPHANUM_PATTERN = r"\w"

#: Pattern to check the value of language component of CPE name
_LANGTAG_PATTERN = "^([a-z]{2,3}(-([a-z]{2}|[\d]{3}))?)$"
_LANGTAG_PATTERN = r"^([a-z]{2,3}(-([a-z]{2}|[\d]{3}))?)$"

#: Pattern to check the value of part component of CPE name
_PART_PATTERN = "^(h|o|a)$"
Expand Down
10 changes: 5 additions & 5 deletions tests/unit/test_cpe.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,11 +241,11 @@ def test_equals(self):
the equivalent WFN string.
"""

self.assertEquals(self.c11, self.c22)
self.assertEquals(self.c22, self.c11)
self.assertEquals(self.c11, self.c23_wfn)
self.assertEquals(self.c11, self.c23_fs)
self.assertEquals(self.c23_uri, self.c23_fs)
self.assertEqual(self.c11, self.c22)
self.assertEqual(self.c22, self.c11)
self.assertEqual(self.c11, self.c23_wfn)
self.assertEqual(self.c11, self.c23_fs)
self.assertEqual(self.c23_uri, self.c23_fs)

@pytest.mark.skip(reason="currently broken")
def test_incompatible_versions(self):
Expand Down

0 comments on commit 7a570af

Please sign in to comment.