Fix deprecation warnings in 3.7
This commit is contained in:
@ -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
|
||||||
|
|||||||
@ -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):
|
||||||
|
|||||||
@ -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)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user