]> code.ossystems Code Review - openembedded-core.git/commitdiff
prservice.py: fix do_package with newer Python in Ubuntu 20.04
authorMartin Jansa <Martin.Jansa@gmail.com>
Thu, 2 Apr 2020 17:05:14 +0000 (19:05 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 2 Apr 2020 20:44:04 +0000 (21:44 +0100)
* with Ubuntu 20.04 which is using python 3.8 I'm seeing a lot of errors like:
  ERROR: libxml2-2.9.10-r0 do_package: Can NOT get PRAUTO, exception No module named '_sysconfigdata'
  not sure what caused this from python 3.8, but this seems to work
* PRserv is enabled with:
  PRSERV_HOST = "localhost:0"

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oe/prservice.py

index fcdbe66c198a4024b54df464c7e6ad1eef94d8e0..2d3c9c7e50663e9324a839caa1941b09af2643c4 100644 (file)
@@ -3,6 +3,10 @@
 #
 
 def prserv_make_conn(d, check = False):
+    # Otherwise this fails when called from recipes which e.g. inherit python3native (which sets _PYTHON_SYSCONFIGDATA_NAME) with:
+    # No module named '_sysconfigdata'
+    if '_PYTHON_SYSCONFIGDATA_NAME' in os.environ:
+        del os.environ['_PYTHON_SYSCONFIGDATA_NAME']
     import prserv.serv
     host_params = list([_f for _f in (d.getVar("PRSERV_HOST") or '').split(':') if _f])
     try: