]> git.ipfire.org Git - thirdparty/dnspython.git/commitdiff
Fix ipv6.py invalid escape sequences 301/head
authorCooper Lees <me@cooperlees.com>
Mon, 26 Feb 2018 01:18:02 +0000 (17:18 -0800)
committerGitHub <noreply@github.com>
Mon, 26 Feb 2018 01:18:02 +0000 (17:18 -0800)
dns/ipv6.py:94: DeprecationWarning: invalid escape sequence \d
- Update to use raw strings/bytes

dns/ipv6.py

index fcc0d93001a5a4c50232a43b5ed72c5bc71d89aa..49ef5562e3911bf78aece03111abe789ea880adb 100644 (file)
@@ -22,7 +22,7 @@ import dns.exception
 import dns.ipv4
 from ._compat import xrange, binary_type, maybe_decode
 
-_leading_zero = re.compile('0+([0-9a-f]+)')
+_leading_zero = re.compile(r'0+([0-9a-f]+)')
 
 def inet_ntoa(address):
     """Convert an IPv6 address in binary form to text form.
@@ -91,9 +91,9 @@ def inet_ntoa(address):
         hex = ':'.join(chunks)
     return hex
 
-_v4_ending = re.compile(b'(.*):(\d+\.\d+\.\d+\.\d+)$')
-_colon_colon_start = re.compile(b'::.*')
-_colon_colon_end = re.compile(b'.*::$')
+_v4_ending = re.compile(br'(.*):(\d+\.\d+\.\d+\.\d+)$')
+_colon_colon_start = re.compile(br'::.*')
+_colon_colon_end = re.compile(br'.*::$')
 
 def inet_aton(text):
     """Convert an IPv6 address in text form to binary form.