From c188a0b0bc7cd7083695cf7c6edea337dccf6c87 Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Sat, 5 Jan 2019 20:12:32 +0100 Subject: [PATCH] add "# cython: language_level=3" directive to .pyx files, fixes #4214 in master branch, it was possible to do this via setup.py's cythonize() calls, but we do not have them in 1.1. thus, i modified the source files, setting the language level to 3, which is supported since long in Cython (3str is only supported since recently so might fail with older Cython versions). Before this changeset, current Cython 0.29.x emitted a FutureWarning, but still compiled. The next major release of Cython is said to emit an error instead, so this changeset hopefully avoids the build breaking after a Cython upgrade. --- src/borg/algorithms/checksums.pyx | 2 ++ src/borg/chunker.pyx | 2 +- src/borg/compress.pyx | 2 ++ src/borg/crypto/low_level.pyx | 2 ++ src/borg/hashindex.pyx | 3 ++- src/borg/item.pyx | 2 ++ src/borg/platform/darwin.pyx | 2 ++ src/borg/platform/freebsd.pyx | 2 ++ src/borg/platform/linux.pyx | 2 ++ src/borg/platform/posix.pyx | 2 ++ 10 files changed, 19 insertions(+), 2 deletions(-) diff --git a/src/borg/algorithms/checksums.pyx b/src/borg/algorithms/checksums.pyx index 6645dd0fe..75c67280b 100644 --- a/src/borg/algorithms/checksums.pyx +++ b/src/borg/algorithms/checksums.pyx @@ -1,3 +1,5 @@ +# cython: language_level=3 + from ..helpers import bin_to_hex from libc.stdint cimport uint32_t diff --git a/src/borg/chunker.pyx b/src/borg/chunker.pyx index d2b44f686..9addb051a 100644 --- a/src/borg/chunker.pyx +++ b/src/borg/chunker.pyx @@ -1,4 +1,4 @@ -# -*- coding: utf-8 -*- +# cython: language_level=3 API_VERSION = '1.1_01' diff --git a/src/borg/compress.pyx b/src/borg/compress.pyx index 8fd3323ea..f1e4fd331 100644 --- a/src/borg/compress.pyx +++ b/src/borg/compress.pyx @@ -1,3 +1,5 @@ +# cython: language_level=3 + """ borg.compress ============= diff --git a/src/borg/crypto/low_level.pyx b/src/borg/crypto/low_level.pyx index db0ea8af6..21c41f7f2 100644 --- a/src/borg/crypto/low_level.pyx +++ b/src/borg/crypto/low_level.pyx @@ -1,3 +1,5 @@ +# cython: language_level=3 + """A thin OpenSSL wrapper""" import hashlib diff --git a/src/borg/hashindex.pyx b/src/borg/hashindex.pyx index f14eeea92..57d13240d 100644 --- a/src/borg/hashindex.pyx +++ b/src/borg/hashindex.pyx @@ -1,4 +1,5 @@ -# -*- coding: utf-8 -*- +# cython: language_level=3 + from collections import namedtuple import locale import os diff --git a/src/borg/item.pyx b/src/borg/item.pyx index 7c698baf7..1dc0b1f61 100644 --- a/src/borg/item.pyx +++ b/src/borg/item.pyx @@ -1,3 +1,5 @@ +# cython: language_level=3 + import stat from collections import namedtuple diff --git a/src/borg/platform/darwin.pyx b/src/borg/platform/darwin.pyx index 080d8a69d..f8bdd17a5 100644 --- a/src/borg/platform/darwin.pyx +++ b/src/borg/platform/darwin.pyx @@ -1,3 +1,5 @@ +# cython: language_level=3 + import os from ..helpers import user2uid, group2gid diff --git a/src/borg/platform/freebsd.pyx b/src/borg/platform/freebsd.pyx index cc6d00bd1..2797da309 100644 --- a/src/borg/platform/freebsd.pyx +++ b/src/borg/platform/freebsd.pyx @@ -1,3 +1,5 @@ +# cython: language_level=3 + import os from ..helpers import posix_acl_use_stored_uid_gid diff --git a/src/borg/platform/linux.pyx b/src/borg/platform/linux.pyx index dc980d7c5..d800bdfb1 100644 --- a/src/borg/platform/linux.pyx +++ b/src/borg/platform/linux.pyx @@ -1,3 +1,5 @@ +# cython: language_level=3 + import os import re import stat diff --git a/src/borg/platform/posix.pyx b/src/borg/platform/posix.pyx index 0701ab9e8..6b15ce3b3 100644 --- a/src/borg/platform/posix.pyx +++ b/src/borg/platform/posix.pyx @@ -1,3 +1,5 @@ +# cython: language_level=3 + import errno import os