Dulwich.io dulwich / 8f73bc5
Fix compatibility with Python 3.8. Jelmer Vernooij 2 months ago
6 changed file(s) with 15 addition(s) and 10 deletion(s). Raw diff Collapse all Expand all
2626 env: TEST_REQUIRE=fastimport
2727 dist: xenial
2828 sudo: true
29 - python: 3.8
30 env: TEST_REQUIRE=fastimport
31 dist: xenial
32 sudo: true
2933 - python: 3.6
3034 env: PURE=true
3135 - python: 2.7
3236 env: PURE=true
33 # flakes checker fails on python 3.8-dev:
34 #- python: 3.8-dev
35 # env: TEST_REQUIRE=fastimport
36 # dist: xenial
37 # sudo: true
3837
3938 install:
4039 - travis_retry pip install -U pip coverage codecov flake8 $TEST_REQUIRE
1919
2020 * Fix regression that added a dependency on C git for the
2121 test suite. (Jelmer Vernooij, #720)
22
23 * Fix compatibility with Python 3.8 - mostly deprecation warnings.
24 (Jelmer Vernooij)
2225
2326 0.19.12 2019-08-13
2427
1717 * License, Version 2.0.
1818 */
1919
20 #define PY_SSIZE_T_CLEAN
2021 #include <Python.h>
2122 #include <sys/stat.h>
2223
1717 * License, Version 2.0.
1818 */
1919
20 #define PY_SSIZE_T_CLEAN
2021 #include <Python.h>
2122 #include <stdlib.h>
2223 #include <sys/stat.h>
6061 static PyObject *py_parse_tree(PyObject *self, PyObject *args, PyObject *kw)
6162 {
6263 char *text, *start, *end;
63 int len, strict;
64 Py_ssize_t len; int strict;
6465 size_t namelen;
6566 PyObject *ret, *item, *name, *sha, *py_strict = NULL;
6667 static char *kwlist[] = {"text", "strict", NULL};
1717 * License, Version 2.0.
1818 */
1919
20 #define PY_SSIZE_T_CLEAN
2021 #include <Python.h>
2122 #include <stdint.h>
2223
204205 {
205206 PyObject *unpack_name;
206207 char *sha;
207 int sha_len;
208 Py_ssize_t sha_len;
208209 int start, end;
209210 #if PY_MAJOR_VERSION >= 3
210211 if (!PyArg_ParseTuple(args, "iiy#O", &start, &end,
226227
227228 while (start <= end) {
228229 PyObject *file_sha;
229 int i = (start + end)/2;
230 Py_ssize_t i = (start + end)/2;
230231 int cmp;
231232 file_sha = PyObject_CallFunction(unpack_name, "i", i);
232233 if (file_sha == NULL) {
9999 new_files = set(os.listdir(copy_path))
100100
101101 # Check that we have the exact same files in both repositories
102 self.assertEquals(original_files, new_files)
102 self.assertEqual(original_files, new_files)
103103
104104 for file in original_files:
105105 if file == ".git":
116116 with open(copy_file_path, "rb") as copy_file:
117117 copy_content = copy_file.read()
118118
119 self.assertEquals(original_content, copy_content)
119 self.assertEqual(original_content, copy_content)