From 55b582511e8d1b6d229836a120572ff9375b891b Mon Sep 17 00:00:00 2001 From: SomberNight Date: Thu, 20 Sep 2018 18:31:17 +0200 Subject: [PATCH] fix deprecation warnings in regexes --- electrum/network.py | 4 ++-- electrum/storage.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/electrum/network.py b/electrum/network.py index b5920f6247f6..85dec8b4edd3 100644 --- a/electrum/network.py +++ b/electrum/network.py @@ -62,13 +62,13 @@ def parse_servers(result): pruning_level = '-' if len(item) > 2: for v in item[2]: - if re.match("[st]\d*", v): + if re.match(r"[st]\d*", v): protocol, port = v[0], v[1:] if port == '': port = constants.net.DEFAULT_PORTS[protocol] out[protocol] = port elif re.match("v(.?)+", v): version = v[1:] - elif re.match("p\d*", v): + elif re.match(r"p\d*", v): pruning_level = v[1:] if pruning_level == '': pruning_level = '0' if out: diff --git a/electrum/storage.py b/electrum/storage.py index d3fda8a28053..ac46b059dd3c 100644 --- a/electrum/storage.py +++ b/electrum/storage.py @@ -54,7 +54,7 @@ def multisig_type(wallet_type): otherwise return None.''' if not wallet_type: return None - match = re.match('(\d+)of(\d+)', wallet_type) + match = re.match(r'(\d+)of(\d+)', wallet_type) if match: match = [int(x) for x in match.group(1, 2)] return match