From 78921ab3f8199f5f8f734ebb320c853cdbc8b58c Mon Sep 17 00:00:00 2001 From: Karthikeyan Singaravelan Date: Sat, 11 Apr 2020 15:00:35 +0000 Subject: [PATCH] Fix deprecation warning regarding invalid escape sequences. --- pretty_bad_protocol/_meta.py | 2 +- pretty_bad_protocol/_parsers.py | 2 +- pretty_bad_protocol/_util.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pretty_bad_protocol/_meta.py b/pretty_bad_protocol/_meta.py index ac6ea40..6a08776 100644 --- a/pretty_bad_protocol/_meta.py +++ b/pretty_bad_protocol/_meta.py @@ -54,7 +54,7 @@ from ._parsers import _sanitise_list from ._util import log -_VERSION_RE = re.compile('^\d+\.\d+\.\d+$') +_VERSION_RE = re.compile(r'^\d+\.\d+\.\d+$') class GPGMeta(type): diff --git a/pretty_bad_protocol/_parsers.py b/pretty_bad_protocol/_parsers.py index 6af3d6d..7f16a92 100644 --- a/pretty_bad_protocol/_parsers.py +++ b/pretty_bad_protocol/_parsers.py @@ -843,7 +843,7 @@ def __init__(self, expiration_time, passphrase=None): def _clean_key_expiration_option(self): """validates the expiration option supplied""" - allowed_entry = re.findall('^(\d+)(|w|m|y)$', self._expiration_time) + allowed_entry = re.findall(r'^(\d+)(|w|m|y)$', self._expiration_time) if not allowed_entry: raise UsageError("Key expiration option: %s is not valid" % self._expiration_time) diff --git a/pretty_bad_protocol/_util.py b/pretty_bad_protocol/_util.py index 1f4e4a5..ed9df4f 100644 --- a/pretty_bad_protocol/_util.py +++ b/pretty_bad_protocol/_util.py @@ -126,7 +126,7 @@ log = _logger.create_logger(0) #: Compiled regex for determining a GnuPG binary's version: -_VERSION_STRING_REGEX = re.compile('(\d)(\.)(\d)(\.)(\d+)') +_VERSION_STRING_REGEX = re.compile(r'(\d)(\.)(\d)(\.)(\d+)') class GnuPGVersionError(ValueError):