summaryrefslogtreecommitdiff
path: root/meta/classes/npm.bbclass
diff options
context:
space:
mode:
authorPatrick Ohly <patrick.ohly@intel.com>2016-06-10 10:04:51 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-06-12 23:42:41 +0100
commit241e094bcd9212204350f9855257474908f82a3c (patch)
treec9afbbbd05899ad90b422d350791ac61824da9ed /meta/classes/npm.bbclass
parent0632c3e69070e340218c1c1c835b2343cd143d8d (diff)
downloadopenembedded-core-241e094bcd9212204350f9855257474908f82a3c.tar.gz
openembedded-core-241e094bcd9212204350f9855257474908f82a3c.tar.bz2
openembedded-core-241e094bcd9212204350f9855257474908f82a3c.zip
npm.bbclass: avoid str/byte conversion problems for PKGV and SUMMARY
In Python3, str.encode() returns byte strings, which later are not converted back to strings automatically, leading to "TypeError: Can't convert 'bytes' object to str implicitly" in code which reads PKGV and SUMMARY and expects to find strings there. The npm.bbclass must use values for d.setVar() that meet that expectation, and thus the redundant (and in Python3, harmful) .encode() gets removed. Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'meta/classes/npm.bbclass')
-rw-r--r--meta/classes/npm.bbclass4
1 files changed, 2 insertions, 2 deletions
diff --git a/meta/classes/npm.bbclass b/meta/classes/npm.bbclass
index d0d3d8fa03..95be7518a8 100644
--- a/meta/classes/npm.bbclass
+++ b/meta/classes/npm.bbclass
@@ -46,10 +46,10 @@ python populate_packages_prepend () {
if pdata:
version = pdata.get('version', None)
if version:
- d.setVar('PKGV_%s' % expanded_pkgname, version.encode("utf8"))
+ d.setVar('PKGV_%s' % expanded_pkgname, version)
description = pdata.get('description', None)
if description:
- d.setVar('SUMMARY_%s' % expanded_pkgname, description.replace(u"\u2018", "'").replace(u"\u2019", "'").encode("utf8"))
+ d.setVar('SUMMARY_%s' % expanded_pkgname, description.replace(u"\u2018", "'").replace(u"\u2019", "'"))
d.appendVar('RDEPENDS_%s' % d.getVar('PN', True), ' %s' % ' '.join(pkgnames).replace('_', '-'))
}