Fix deprecation warnings in 3.7

This commit is contained in:
Kryštof Pilnáček
2018-10-28 13:11:14 +01:00
parent 5924de6a12
commit b95efadf23
3 changed files with 3 additions and 3 deletions

View File

@ -1,4 +1,4 @@
from collections import Iterable
from collections.abc import Iterable
from contextlib import contextmanager
from functools import partial
from inspect import signature

View File

@ -6,7 +6,7 @@ import warnings
from contextlib import contextmanager
__escape_decoder = codecs.getdecoder("unicode_escape")
__posix_variable = re.compile("\$\{[^\}]*\}")
__posix_variable = re.compile(r"\$\{[^\}]*\}")
def parse_var(var):

View File

@ -24,7 +24,7 @@ def sweeten_errors():
length = len(pre_re.sub("\\1\\2\\3", arg))
arg = pre_re.sub(w("\\1") + term.bold("\\2") + w("\\3"), arg)
arg = re.sub("^ \$ (.*)", term.lightblack(" $ ") + term.reset("\\1"), arg)
arg = re.sub(r"^ \$ (.*)", term.lightblack(" $ ") + term.reset("\\1"), arg)
return (arg, length)