Browse Source

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.
Thomas Waldmann 6 years ago
parent
commit
c188a0b0bc

+ 2 - 0
src/borg/algorithms/checksums.pyx

@@ -1,3 +1,5 @@
+# cython: language_level=3
+
 from ..helpers import bin_to_hex
 from ..helpers import bin_to_hex
 
 
 from libc.stdint cimport uint32_t
 from libc.stdint cimport uint32_t

+ 1 - 1
src/borg/chunker.pyx

@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# cython: language_level=3
 
 
 API_VERSION = '1.1_01'
 API_VERSION = '1.1_01'
 
 

+ 2 - 0
src/borg/compress.pyx

@@ -1,3 +1,5 @@
+# cython: language_level=3
+
 """
 """
 borg.compress
 borg.compress
 =============
 =============

+ 2 - 0
src/borg/crypto/low_level.pyx

@@ -1,3 +1,5 @@
+# cython: language_level=3
+
 """A thin OpenSSL wrapper"""
 """A thin OpenSSL wrapper"""
 
 
 import hashlib
 import hashlib

+ 2 - 1
src/borg/hashindex.pyx

@@ -1,4 +1,5 @@
-# -*- coding: utf-8 -*-
+# cython: language_level=3
+
 from collections import namedtuple
 from collections import namedtuple
 import locale
 import locale
 import os
 import os

+ 2 - 0
src/borg/item.pyx

@@ -1,3 +1,5 @@
+# cython: language_level=3
+
 import stat
 import stat
 from collections import namedtuple
 from collections import namedtuple
 
 

+ 2 - 0
src/borg/platform/darwin.pyx

@@ -1,3 +1,5 @@
+# cython: language_level=3
+
 import os
 import os
 
 
 from ..helpers import user2uid, group2gid
 from ..helpers import user2uid, group2gid

+ 2 - 0
src/borg/platform/freebsd.pyx

@@ -1,3 +1,5 @@
+# cython: language_level=3
+
 import os
 import os
 
 
 from ..helpers import posix_acl_use_stored_uid_gid
 from ..helpers import posix_acl_use_stored_uid_gid

+ 2 - 0
src/borg/platform/linux.pyx

@@ -1,3 +1,5 @@
+# cython: language_level=3
+
 import os
 import os
 import re
 import re
 import stat
 import stat

+ 2 - 0
src/borg/platform/posix.pyx

@@ -1,3 +1,5 @@
+# cython: language_level=3
+
 import errno
 import errno
 import os
 import os