diff options
Diffstat (limited to 'recipes-bsp/u-boot/u-boot-qoriq/0001-pylibfdt-Convert-to-Python-3.patch')
| -rw-r--r-- | recipes-bsp/u-boot/u-boot-qoriq/0001-pylibfdt-Convert-to-Python-3.patch | 117 |
1 files changed, 0 insertions, 117 deletions
diff --git a/recipes-bsp/u-boot/u-boot-qoriq/0001-pylibfdt-Convert-to-Python-3.patch b/recipes-bsp/u-boot/u-boot-qoriq/0001-pylibfdt-Convert-to-Python-3.patch deleted file mode 100644 index e74609de1..000000000 --- a/recipes-bsp/u-boot/u-boot-qoriq/0001-pylibfdt-Convert-to-Python-3.patch +++ /dev/null | |||
| @@ -1,117 +0,0 @@ | |||
| 1 | From b4cf5f1df741e8781bed6149291823cd1a4b8baa Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Simon Glass <sjg@chromium.org> | ||
| 3 | Date: Thu, 31 Oct 2019 07:42:59 -0600 | ||
| 4 | Subject: [PATCH] pylibfdt: Convert to Python 3 | ||
| 5 | |||
| 6 | Build this swig module with Python 3. | ||
| 7 | |||
| 8 | Upstream-Status: Backport | ||
| 9 | |||
| 10 | Signed-off-by: Simon Glass <sjg@chromium.org> | ||
| 11 | --- | ||
| 12 | scripts/dtc/pylibfdt/Makefile | 2 +- | ||
| 13 | scripts/dtc/pylibfdt/libfdt.i_shipped | 2 +- | ||
| 14 | scripts/dtc/pylibfdt/setup.py | 2 +- | ||
| 15 | tools/binman/entry.py | 16 ++-------------- | ||
| 16 | tools/binman/entry_test.py | 15 --------------- | ||
| 17 | 5 files changed, 5 insertions(+), 32 deletions(-) | ||
| 18 | |||
| 19 | diff --git a/scripts/dtc/pylibfdt/Makefile b/scripts/dtc/pylibfdt/Makefile | ||
| 20 | index 15e66ad44d..42342c75bb 100644 | ||
| 21 | --- a/scripts/dtc/pylibfdt/Makefile | ||
| 22 | +++ b/scripts/dtc/pylibfdt/Makefile | ||
| 23 | @@ -21,7 +21,7 @@ quiet_cmd_pymod = PYMOD $@ | ||
| 24 | CPPFLAGS="$(HOSTCFLAGS) -I$(LIBFDT_srcdir)" OBJDIR=$(obj) \ | ||
| 25 | SOURCES="$(PYLIBFDT_srcs)" \ | ||
| 26 | SWIG_OPTS="-I$(LIBFDT_srcdir) -I$(LIBFDT_srcdir)/.." \ | ||
| 27 | - $(PYTHON2) $< --quiet build_ext --inplace | ||
| 28 | + $(PYTHON3) $< --quiet build_ext --inplace | ||
| 29 | |||
| 30 | $(obj)/_libfdt.so: $(src)/setup.py $(PYLIBFDT_srcs) FORCE | ||
| 31 | $(call if_changed,pymod) | ||
| 32 | diff --git a/scripts/dtc/pylibfdt/libfdt.i_shipped b/scripts/dtc/pylibfdt/libfdt.i_shipped | ||
| 33 | index 76e61e98bd..53b70f8f5e 100644 | ||
| 34 | --- a/scripts/dtc/pylibfdt/libfdt.i_shipped | ||
| 35 | +++ b/scripts/dtc/pylibfdt/libfdt.i_shipped | ||
| 36 | @@ -624,7 +624,7 @@ class Fdt(FdtRo): | ||
| 37 | Raises: | ||
| 38 | FdtException if no parent found or other error occurs | ||
| 39 | """ | ||
| 40 | - val = val.encode('utf-8') + '\0' | ||
| 41 | + val = val.encode('utf-8') + b'\0' | ||
| 42 | return check_err(fdt_setprop(self._fdt, nodeoffset, prop_name, | ||
| 43 | val, len(val)), quiet) | ||
| 44 | |||
| 45 | diff --git a/scripts/dtc/pylibfdt/setup.py b/scripts/dtc/pylibfdt/setup.py | ||
| 46 | index 4f7cf042bf..992cdec30f 100755 | ||
| 47 | --- a/scripts/dtc/pylibfdt/setup.py | ||
| 48 | +++ b/scripts/dtc/pylibfdt/setup.py | ||
| 49 | @@ -1,4 +1,4 @@ | ||
| 50 | -#!/usr/bin/env python2 | ||
| 51 | +#!/usr/bin/env python3 | ||
| 52 | |||
| 53 | """ | ||
| 54 | setup.py file for SWIG libfdt | ||
| 55 | diff --git a/tools/binman/entry.py b/tools/binman/entry.py | ||
| 56 | index 409c0dca93..5bf5be4794 100644 | ||
| 57 | --- a/tools/binman/entry.py | ||
| 58 | +++ b/tools/binman/entry.py | ||
| 59 | @@ -7,16 +7,7 @@ | ||
| 60 | from __future__ import print_function | ||
| 61 | |||
| 62 | from collections import namedtuple | ||
| 63 | - | ||
| 64 | -# importlib was introduced in Python 2.7 but there was a report of it not | ||
| 65 | -# working in 2.7.12, so we work around this: | ||
| 66 | -# http://lists.denx.de/pipermail/u-boot/2016-October/269729.html | ||
| 67 | -try: | ||
| 68 | - import importlib | ||
| 69 | - have_importlib = True | ||
| 70 | -except: | ||
| 71 | - have_importlib = False | ||
| 72 | - | ||
| 73 | +import importlib | ||
| 74 | import os | ||
| 75 | import sys | ||
| 76 | |||
| 77 | @@ -119,10 +110,7 @@ class Entry(object): | ||
| 78 | old_path = sys.path | ||
| 79 | sys.path.insert(0, os.path.join(our_path, 'etype')) | ||
| 80 | try: | ||
| 81 | - if have_importlib: | ||
| 82 | - module = importlib.import_module(module_name) | ||
| 83 | - else: | ||
| 84 | - module = __import__(module_name) | ||
| 85 | + module = importlib.import_module(module_name) | ||
| 86 | except ImportError as e: | ||
| 87 | raise ValueError("Unknown entry type '%s' in node '%s' (expected etype/%s.py, error '%s'" % | ||
| 88 | (etype, node_path, module_name, e)) | ||
| 89 | diff --git a/tools/binman/entry_test.py b/tools/binman/entry_test.py | ||
| 90 | index 13f5864516..277e10b585 100644 | ||
| 91 | --- a/tools/binman/entry_test.py | ||
| 92 | +++ b/tools/binman/entry_test.py | ||
| 93 | @@ -39,21 +39,6 @@ class TestEntry(unittest.TestCase): | ||
| 94 | else: | ||
| 95 | import entry | ||
| 96 | |||
| 97 | - def test1EntryNoImportLib(self): | ||
| 98 | - """Test that we can import Entry subclassess successfully""" | ||
| 99 | - sys.modules['importlib'] = None | ||
| 100 | - global entry | ||
| 101 | - self._ReloadEntry() | ||
| 102 | - entry.Entry.Create(None, self.GetNode(), 'u-boot') | ||
| 103 | - self.assertFalse(entry.have_importlib) | ||
| 104 | - | ||
| 105 | - def test2EntryImportLib(self): | ||
| 106 | - del sys.modules['importlib'] | ||
| 107 | - global entry | ||
| 108 | - self._ReloadEntry() | ||
| 109 | - entry.Entry.Create(None, self.GetNode(), 'u-boot-spl') | ||
| 110 | - self.assertTrue(entry.have_importlib) | ||
| 111 | - | ||
| 112 | def testEntryContents(self): | ||
| 113 | """Test the Entry bass class""" | ||
| 114 | import entry | ||
| 115 | -- | ||
| 116 | 2.24.0 | ||
| 117 | |||
