summaryrefslogtreecommitdiff
path: root/git
diff options
context:
space:
mode:
authorVille Skyttä <ville.skytta@iki.fi>2017-03-09 11:40:20 +0200
committerSebastian Thiel <byronimo@gmail.com>2017-04-09 19:59:44 +0200
commit32da7feb496ef31c48b5cbe4e37a4c68ed1b7dd5 (patch)
tree8feb952f64aa97916e2e717b905916713f2d2246 /git
parent39335e6242c93d5ba75e7ab8d7926f5a49c119a3 (diff)
downloadgitpython-32da7feb496ef31c48b5cbe4e37a4c68ed1b7dd5.tar.gz
Python 3.6 invalid escape sequence deprecation fixes
https://docs.python.org/3/whatsnew/3.6.html#deprecated-python-behavior
Diffstat (limited to 'git')
-rw-r--r--git/config.py2
-rw-r--r--git/remote.py4
-rw-r--r--git/test/lib/helper.py2
-rw-r--r--git/test/test_git.py2
-rw-r--r--git/test/test_index.py2
-rw-r--r--git/test/test_repo.py2
-rw-r--r--git/test/test_submodule.py6
-rw-r--r--git/test/test_tree.py4
8 files changed, 12 insertions, 12 deletions
diff --git a/git/config.py b/git/config.py
index cd2f10f9..7d962276 100644
--- a/git/config.py
+++ b/git/config.py
@@ -169,7 +169,7 @@ class GitConfigParser(with_metaclass(MetaParserBuilder, cp.RawConfigParser, obje
# They must be compatible to the LockFile interface.
# A suitable alternative would be the BlockingLockFile
t_lock = LockFile
- re_comment = re.compile('^\s*[#;]')
+ re_comment = re.compile(r'^\s*[#;]')
#} END configuration
diff --git a/git/remote.py b/git/remote.py
index e5480d0e..60319ce1 100644
--- a/git/remote.py
+++ b/git/remote.py
@@ -208,7 +208,7 @@ class FetchInfo(object):
NEW_TAG, NEW_HEAD, HEAD_UPTODATE, TAG_UPDATE, REJECTED, FORCED_UPDATE, \
FAST_FORWARD, ERROR = [1 << x for x in range(8)]
- re_fetch_result = re.compile('^\s*(.) (\[?[\w\s\.$@]+\]?)\s+(.+) -> ([^\s]+)( \(.*\)?$)?')
+ re_fetch_result = re.compile(r'^\s*(.) (\[?[\w\s\.$@]+\]?)\s+(.+) -> ([^\s]+)( \(.*\)?$)?')
_flag_map = {'!': ERROR,
'+': FORCED_UPDATE,
@@ -391,7 +391,7 @@ class Remote(LazyMixin, Iterable):
def __getattr__(self, attr):
"""Allows to call this instance like
- remote.special( \*args, \*\*kwargs) to call git-remote special self.name"""
+ remote.special( \\*args, \\*\\*kwargs) to call git-remote special self.name"""
if attr == "_config_reader":
return super(Remote, self).__getattr__(attr)
diff --git a/git/test/lib/helper.py b/git/test/lib/helper.py
index 7d9f6b95..729c76a4 100644
--- a/git/test/lib/helper.py
+++ b/git/test/lib/helper.py
@@ -200,7 +200,7 @@ def git_daemon_launched(base_path, ip, port):
and setting the environment variable GIT_PYTHON_TEST_GIT_DAEMON_PORT to <port>
""")
if is_win:
- msg += textwrap.dedent("""
+ msg += textwrap.dedent(r"""
On Windows,
the `git-daemon.exe` must be in PATH.
diff --git a/git/test/test_git.py b/git/test/test_git.py
index 3ab82b02..3c8b6f82 100644
--- a/git/test/test_git.py
+++ b/git/test/test_git.py
@@ -91,7 +91,7 @@ class TestGit(TestBase):
self.assertEqual(set(['-s', '-t']), set(res))
def test_it_executes_git_to_shell_and_returns_result(self):
- assert_match('^git version [\d\.]{2}.*$', self.git.execute(["git", "version"]))
+ assert_match(r'^git version [\d\.]{2}.*$', self.git.execute(["git", "version"]))
def test_it_accepts_stdin(self):
filename = fixture_path("cat_file_blob")
diff --git a/git/test/test_index.py b/git/test/test_index.py
index 071ac623..e8d38a09 100644
--- a/git/test/test_index.py
+++ b/git/test/test_index.py
@@ -411,7 +411,7 @@ class TestIndex(TestBase):
# END num existing helper
@skipIf(HIDE_WINDOWS_KNOWN_ERRORS and Git.is_cygwin(),
- """FIXME: File "C:\projects\gitpython\git\test\test_index.py", line 642, in test_index_mutation
+ """FIXME: File "C:\\projects\\gitpython\\git\\test\\test_index.py", line 642, in test_index_mutation
self.assertEqual(fd.read(), link_target)
AssertionError: '!<symlink>\xff\xfe/\x00e\x00t\x00c\x00/\x00t\x00h\x00a\x00t\x00\x00\x00'
!= '/etc/that'
diff --git a/git/test/test_repo.py b/git/test/test_repo.py
index 755d31d2..86019b73 100644
--- a/git/test/test_repo.py
+++ b/git/test/test_repo.py
@@ -416,7 +416,7 @@ class TestRepo(TestBase):
self.assertEqual(len(res[0][1]), 83, "Unexpected amount of parsed blame lines")
@skipIf(HIDE_WINDOWS_KNOWN_ERRORS and Git.is_cygwin(),
- """FIXME: File "C:\projects\gitpython\git\cmd.py", line 671, in execute
+ """FIXME: File "C:\\projects\\gitpython\\git\\cmd.py", line 671, in execute
raise GitCommandError(command, status, stderr_value, stdout_value)
GitCommandError: Cmd('git') failed due to: exit code(128)
cmdline: git add 1__��ava verb��ten 1_test _myfile 1_test_other_file
diff --git a/git/test/test_submodule.py b/git/test/test_submodule.py
index 0a6c4880..9e79a72c 100644
--- a/git/test/test_submodule.py
+++ b/git/test/test_submodule.py
@@ -423,10 +423,10 @@ class TestSubmodule(TestBase):
self._do_base_tests(rwrepo)
@skipIf(HIDE_WINDOWS_KNOWN_ERRORS and sys.version_info[:2] == (3, 5), """
- File "C:\projects\gitpython\git\cmd.py", line 559, in execute
+ File "C:\\projects\\gitpython\\git\\cmd.py", line 559, in execute
raise GitCommandNotFound(command, err)
git.exc.GitCommandNotFound: Cmd('git') not found due to: OSError('[WinError 6] The handle is invalid')
- cmdline: git clone -n --shared -v C:\projects\gitpython\.git Users\appveyor\AppData\Local\Temp\1\tmplyp6kr_rnon_bare_test_root_module""") # noqa E501
+ cmdline: git clone -n --shared -v C:\\projects\\gitpython\\.git Users\\appveyor\\AppData\\Local\\Temp\\1\\tmplyp6kr_rnon_bare_test_root_module""") # noqa E501
@with_rw_repo(k_subm_current, bare=False)
def test_root_module(self, rwrepo):
# Can query everything without problems
@@ -664,7 +664,7 @@ class TestSubmodule(TestBase):
# end for each checkout mode
@skipIf(HIDE_WINDOWS_KNOWN_ERRORS and Git.is_cygwin(),
- """FIXME: ile "C:\projects\gitpython\git\cmd.py", line 671, in execute
+ """FIXME: ile "C:\\projects\\gitpython\\git\\cmd.py", line 671, in execute
raise GitCommandError(command, status, stderr_value, stdout_value)
GitCommandError: Cmd('git') failed due to: exit code(128)
cmdline: git add 1__Xava verbXXten 1_test _myfile 1_test_other_file 1_XXava-----verbXXten
diff --git a/git/test/test_tree.py b/git/test/test_tree.py
index ab85bc9c..5fd4d760 100644
--- a/git/test/test_tree.py
+++ b/git/test/test_tree.py
@@ -24,7 +24,7 @@ import os.path as osp
class TestTree(TestBase):
@skipIf(HIDE_WINDOWS_KNOWN_ERRORS and sys.version_info[:2] == (3, 5), """
- File "C:\projects\gitpython\git\cmd.py", line 559, in execute
+ File "C:\\projects\\gitpython\\git\\cmd.py", line 559, in execute
raise GitCommandNotFound(command, err)
git.exc.GitCommandNotFound: Cmd('git') not found due to: OSError('[WinError 6] The handle is invalid')
cmdline: git cat-file --batch-check""")
@@ -57,7 +57,7 @@ class TestTree(TestBase):
# END for each item in tree
@skipIf(HIDE_WINDOWS_KNOWN_ERRORS and sys.version_info[:2] == (3, 5), """
- File "C:\projects\gitpython\git\cmd.py", line 559, in execute
+ File "C:\\projects\\gitpython\\git\\cmd.py", line 559, in execute
raise GitCommandNotFound(command, err)
git.exc.GitCommandNotFound: Cmd('git') not found due to: OSError('[WinError 6] The handle is invalid')
cmdline: git cat-file --batch-check""")