deprecation warning fixes

This commit is contained in:
Anthony Scopatz 2018-10-11 12:04:48 -04:00
parent c645f59347
commit 579ccd07d9
8 changed files with 23 additions and 21 deletions

View file

@ -40,7 +40,6 @@ jobs:
command: |
export PATH="$HOME/miniconda/bin:$PATH"
source activate ${ENV_NAME}
#python setup.py install
pip install . --no-deps
- run:
command: |
@ -85,7 +84,6 @@ jobs:
command: |
export PATH="$HOME/miniconda/bin:$PATH"
source activate ${ENV_NAME}
#python setup.py install
pip install . --no-deps
- run:
command: |
@ -130,7 +128,6 @@ jobs:
command: |
export PATH="$HOME/miniconda/bin:$PATH"
source activate ${ENV_NAME}
#python setup.py install
pip install . --no-deps
- run:
command: |
@ -175,7 +172,6 @@ jobs:
command: |
export PATH="$HOME/miniconda/bin:$PATH"
source activate ${ENV_NAME}
#python setup.py install
pip install . --no-deps
- run:
command: |

View file

@ -10,6 +10,8 @@
**Removed:** None
**Fixed:** None
**Fixed:**
* Fixed further raw string deprecation warnings thoughout the code base.
**Security:** None

View file

@ -32,6 +32,14 @@ def source_path():
return os.path.dirname(pwd)
def ensure_attached_session(session):
builtins.__xonsh__ = session
if not hasattr(builtins, '__xonsh__'):
# I have no idea why pytest fails to assign into the builtins module
# sometimes, but the following globals trick seems to work -scopatz
globals()['__builtins__']['__xonsh__'] = session
@pytest.fixture
def xonsh_execer(monkeypatch):
"""Initiate the Execer with a mocked nop `load_builtins`"""
@ -40,7 +48,7 @@ def xonsh_execer(monkeypatch):
(lambda *args, **kwargs: None).__code__,
)
if not hasattr(builtins, "__xonsh__"):
builtins.__xonsh__ = XonshSession()
ensure_attached_session(XonshSession())
execer = Execer(unload=False)
builtins.__xonsh__.execer = execer
return execer
@ -62,11 +70,7 @@ def xonsh_builtins(xonsh_events):
old_builtins = set(dir(builtins))
execer = getattr(getattr(builtins, "__xonsh__", None), "execer", None)
session = XonshSession(execer=execer, ctx={})
builtins.__xonsh__ = session
if not hasattr(builtins, '__xonsh__'):
# I have no idea why pytest fails to assign into the builtins module
# sometimes, but the following globals trick seems to work -scopatz
globals()['__builtins__']['__xonsh__'] = session
ensure_attached_session(session)
builtins.__xonsh__.env = DummyEnv()
if ON_WINDOWS:
builtins.__xonsh__.env["PATHEXT"] = [".EXE", ".BAT", ".CMD"]

View file

@ -250,7 +250,7 @@ def get_script_subproc_command(fname, args):
@lazyobject
def _REDIR_REGEX():
name = "(o(?:ut)?|e(?:rr)?|a(?:ll)?|&?\d?)"
name = r"(o(?:ut)?|e(?:rr)?|a(?:ll)?|&?\d?)"
return re.compile("{r}(>?>|<){r}$".format(r=name))
@ -1147,7 +1147,7 @@ def call_macro(f, raw_args, glbs, locs):
@lazyobject
def KWARG_RE():
return re.compile("([A-Za-z_]\w*=|\*\*)")
return re.compile(r"([A-Za-z_]\w*=|\*\*)")
def _starts_as_arg(s):

View file

@ -18,7 +18,7 @@ _unc_tempDrives = {}
def _unc_check_enabled() -> bool:
"""Check whether CMD.EXE is enforcing no-UNC-as-working-directory check.
r"""Check whether CMD.EXE is enforcing no-UNC-as-working-directory check.
Check can be disabled by setting {HKCU, HKLM}/SOFTWARE\Microsoft\Command Processor\DisableUNCCheck:REG_DWORD=1
@ -291,7 +291,7 @@ def pushd_parser():
def pushd(args, stdin=None):
"""xonsh command: pushd
r"""xonsh command: pushd
Adds a directory to the top of the directory stack, or rotates the stack,
making the new top of the stack the current working directory.

View file

@ -83,7 +83,7 @@ RE_HIDDEN_BYTES = LazyObject(
@lazyobject
def RE_VT100_ESCAPE():
return re.compile(b"(\x9B|\x1B\[)[0-?]*[ -\/]*[@-~]")
return re.compile(b"(\x9B|\x1B\\[)[0-?]*[ -\\/]*[@-~]")
@lazyobject
@ -825,7 +825,7 @@ class PopenThread(threading.Thread):
#
def _signal_quit(self, signum, frame):
"""Signal handler for quiting SIGQUIT - Ctrl+\ may have been pressed.
r"""Signal handler for quiting SIGQUIT - Ctrl+\ may have been pressed.
"""
self.send_signal(signum)
self._restore_sigquit(frame=frame)

View file

@ -114,10 +114,10 @@ def setup_readline():
readline.set_history_length(-1)
ReadlineHistoryAdder()
# sets up IPython-like history matching with up and down
readline.parse_and_bind('"\e[B": history-search-forward')
readline.parse_and_bind('"\e[A": history-search-backward')
readline.parse_and_bind('"\\e[B": history-search-forward')
readline.parse_and_bind('"\\e[A": history-search-backward')
# Setup Shift-Tab to indent
readline.parse_and_bind('"\e[Z": "{0}"'.format(env.get("INDENT")))
readline.parse_and_bind('"\\e[Z": "{0}"'.format(env.get("INDENT")))
# handle tab completion differences found in libedit readline compatibility
# as discussed at http://stackoverflow.com/a/7116997

View file

@ -345,7 +345,7 @@ Operator = group(
r"!\[",
r"\$\(",
r"\$\[",
"\${",
r"\${",
r"\?\?",
r"\?",
AUGASSIGN_OPS,