aboutsummaryrefslogtreecommitdiffstats
path: root/testing/py3-py-cpuinfo/add-s390x.patch
diff options
context:
space:
mode:
Diffstat (limited to 'testing/py3-py-cpuinfo/add-s390x.patch')
-rw-r--r--testing/py3-py-cpuinfo/add-s390x.patch37
1 files changed, 37 insertions, 0 deletions
diff --git a/testing/py3-py-cpuinfo/add-s390x.patch b/testing/py3-py-cpuinfo/add-s390x.patch
new file mode 100644
index 0000000000..9b768dabf2
--- /dev/null
+++ b/testing/py3-py-cpuinfo/add-s390x.patch
@@ -0,0 +1,37 @@
+--- a/cpuinfo/cpuinfo.py
++++ b/cpuinfo/cpuinfo.py
+@@ -1,4 +1,3 @@
+-#!/usr/bin/env python
+ # -*- coding: UTF-8 -*-
+
+ # Copyright (c) 2014-2019, Matthew Brennan Jones <matthew.brennan.jones@gmail.com>
+@@ -228,8 +227,8 @@
+ # Make sure we are running on a supported system
+ def _check_arch():
+ arch, bits = _parse_arch(DataSource.raw_arch_string)
+- if not arch in ['X86_32', 'X86_64', 'ARM_7', 'ARM_8', 'PPC_64']:
+- raise Exception("py-cpuinfo currently only works on X86 and some PPC and ARM CPUs.")
++ if not arch in ['X86_32', 'X86_64', 'ARM_7', 'ARM_8', 'PPC_64', 'S390X']:
++ raise Exception("py-cpuinfo currently only works on X86 and some PPC and ARM and S390X CPUs.")
+
+ def _obj_to_b64(thing):
+ import pickle
+@@ -583,6 +582,10 @@
+ bits = 32
+ elif re.match('^powerpc$|^ppc64$|^ppc64le$', raw_arch_string):
+ arch = 'PPC_64'
++ bits = 64
++ # S390X
++ elif re.match('^s390x$', raw_arch_string):
++ arch = 'S390X'
+ bits = 64
+ # SPARC
+ elif re.match('^sparc32$|^sparc$', raw_arch_string):
+--- a/tests/test_invalid_cpu.py
++++ b/tests/test_invalid_cpu.py
+@@ -32,4 +32,4 @@
+ cpuinfo._check_arch()
+ self.fail('Failed to raise Exception')
+ except Exception as err:
+- self.assertEqual('py-cpuinfo currently only works on X86 and some PPC and ARM CPUs.', err.args[0])
++ self.assertEqual('py-cpuinfo currently only works on X86 and some PPC and ARM and S390X CPUs.', err.args[0])