diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 00:36:32 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 00:36:32 +0000 |
commit | a2a6c93b4bcc1c9c3274d9b6932a54b11996df5b (patch) | |
tree | 33b4ec950f6f14b16d5d2bcc8738a6f68ce52edd /debian/patches/big_endian.patch | |
parent | Merging upstream version 0.18.6+ds. (diff) | |
download | ruamel.yaml-a2a6c93b4bcc1c9c3274d9b6932a54b11996df5b.tar.xz ruamel.yaml-a2a6c93b4bcc1c9c3274d9b6932a54b11996df5b.zip |
Merging debian version 0.18.6+ds-1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/patches/big_endian.patch')
-rw-r--r-- | debian/patches/big_endian.patch | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/debian/patches/big_endian.patch b/debian/patches/big_endian.patch new file mode 100644 index 0000000..ae0af7d --- /dev/null +++ b/debian/patches/big_endian.patch @@ -0,0 +1,54 @@ +Author: Michael R. Crusoe <crusoe@debian.org>, Julian Gilbey <jdg@debian.org> +Description: Default to pure python parsing on big endian systems + The current version fails on big-endian systems as described in + https://sourceforge.net/p/ruamel-yaml/tickets/360/ and + https://sourceforge.net/p/ruamel-yaml-clib/tickets/34/ + . + The current version of this patch completely disables the C extension on + big-endian systems. + . + Thanks to Rebecca N. Palmer for the tip about sys.byteorder! +Forwarded: not-needed +Last-Update: 2024-04-18 + +--- a/__init__.py ++++ b/__init__.py +@@ -1,4 +1,5 @@ + + from __future__ import annotations ++import sys + + if False: # MYPY +@@ -47,11 +47,13 @@ + version_info = _package_data['version_info'] + __version__ = _package_data['__version__'] + +-try: +- from .cyaml import * # NOQA +- +- __with_libyaml__ = True +-except (ImportError, ValueError): # for Jython +- __with_libyaml__ = False ++__with_libyaml__ = False ++if sys.byteorder == "little": ++ try: ++ from .cyaml import * # NOQA ++ ++ __with_libyaml__ = True ++ except (ImportError, ValueError): # for Jython ++ pass + + from ruamel.yaml.main import * # NOQA +--- a/_test/test_cyaml.py ++++ b/_test/test_cyaml.py +@@ -7,6 +7,10 @@ + + NO_CLIB_VER = (3, 12) + ++@pytest.mark.skipif( ++ sys.byteorder == "big", ++ reason="compiled library disabled on big-endian machines" ++) + + @pytest.mark.skipif( # type: ignore + platform.python_implementation() in ['Jython', 'PyPy'], |