Merge pull request #297 from KPilnacek/fix_depracation_warnings_for_python_3-7

Fix deprecation warnings in 3.7
This commit is contained in:
Romain Dorgueil
2018-10-28 13:44:32 +01:00
committed by GitHub
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 contextlib import contextmanager
from functools import partial from functools import partial
from inspect import signature from inspect import signature

View File

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

View File

@ -24,7 +24,7 @@ def sweeten_errors():
length = len(pre_re.sub("\\1\\2\\3", arg)) length = len(pre_re.sub("\\1\\2\\3", arg))
arg = pre_re.sub(w("\\1") + term.bold("\\2") + w("\\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) return (arg, length)