Skip to content

Commit

Permalink
Remove old code for 3.5 compat
Browse files Browse the repository at this point in the history
  • Loading branch information
jdavid committed Oct 15, 2020
1 parent e57dd6e commit da8e114
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,15 @@ pgit_borrow_encoding(PyObject *value, const char *encoding, PyObject **tvalue)
PyObject *py_value = NULL;
PyObject *py_str = NULL;

#if defined(HAS_FSPATH_SUPPORT)
#if defined(PYPY_VERSION) && PYPY_VERSION_NUM < 0x07030000
py_value = value;
Py_INCREF(value);
#else
py_value = PyOS_FSPath(value);
if (py_value == NULL) {
Error_type_error("unexpected %.200s", value);
return NULL;
}
#else
py_value = value;
Py_INCREF(value);
#endif

// Get new PyBytes reference from value
Expand Down
4 changes: 0 additions & 4 deletions src/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,6 @@
# define PYGIT2_FN_UNUSED
#endif

#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 6 && (!defined(PYPY_VERSION) || PYPY_VERSION_NUM >= 0x07030000)
#define HAS_FSPATH_SUPPORT
#endif

#define to_path(x) to_unicode(x, Py_FileSystemDefaultEncoding, "strict")
#define to_encoding(x) PyUnicode_DecodeASCII(x, strlen(x), "strict")

Expand Down

0 comments on commit da8e114

Please sign in to comment.