Skip to content

Commit

Permalink
Invalid escape sequence fixes (#638)
Browse files Browse the repository at this point in the history
* Python 3.6 invalid escape sequence deprecation fixes

https://docs.python.org/3/whatsnew/3.6.html#deprecated-python-behavior

* Make version from basename getter regex simpler and stricter

Was missing a backslash from tar matcher.
  • Loading branch information
scop authored and obestwalter committed Sep 16, 2017
1 parent 30bda08 commit 6b1b65b
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -1201,7 +1201,7 @@ def test_substitution_double(self, newconfig):
assert argv[0] == ['echo', 'bah']

def test_posargs_backslashed_or_quoted(self, tmpdir, newconfig):
inisource = """
inisource = r"""
[testenv:py27]
commands =
echo "\{posargs\}" = {posargs}
Expand Down
2 changes: 1 addition & 1 deletion tests/test_interpreters.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class envconfig:
name = "python%s" % ver
if sys.platform == "win32":
pydir = "python%s" % ver.replace(".", "")
x = py.path.local("c:\%s" % pydir)
x = py.path.local(r"c:\%s" % pydir)
print(x)
if not x.check():
continue
Expand Down
2 changes: 1 addition & 1 deletion tox/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -927,7 +927,7 @@ def __init__(self, name, url=None):

#: Check value matches substitution form
#: of referencing value from other section. E.g. {[base]commands}
is_section_substitution = re.compile("{\[[^{}\s]+\]\S+?}").match
is_section_substitution = re.compile(r"{\[[^{}\s]+\]\S+?}").match


class SectionReader:
Expand Down
2 changes: 1 addition & 1 deletion tox/interpreters.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def tox_get_python_executable(envconfig):
# Exceptions to the usual windows mapping
win32map = {
'python': sys.executable,
'jython': "c:\jython2.5.1\jython.bat",
'jython': r"c:\jython2.5.1\jython.bat",
}

def locate_via_py(v_maj, v_min):
Expand Down
2 changes: 1 addition & 1 deletion tox/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,7 @@ def _resolvepkg(self, pkgspec):
return candidates[0]


_rex_getversion = re.compile("[\w_\-\+\.]+-(.*)(\.zip|\.tar.gz)")
_rex_getversion = re.compile(r"[\w_\-\+\.]+-(.*)\.(zip|tar\.gz)")


def getversion(basename):
Expand Down

0 comments on commit 6b1b65b

Please sign in to comment.