[Python-modules-team] Bug#926802: ipywidgets: FTBFS (TypeError: path.scope.getBindings(...).hasOwnProperty is not a function)

Sergio Durigan Junior sergiodj at debian.org
Sat Apr 27 20:16:04 BST 2019


tags 926802 + patch
usertags 926802 + bsp-2019-04-ca-toronto
thanks

On Wednesday, April 10 2019, Santiago Vila wrote:

> Dear maintainer:
>
> I tried to build this package in buster but it failed:
[...]

Heya from the Toronto BSP!

So, I've given it a try and managed to... hm...  fix the issue.  My
JavaScript knowledge is rudimentary at best, but with the diff below
makes the build complete without any apparent side effects (i.e., the
testsuite still pass).

Kudos to Samuel Vale for helping verifying the code and making sure it
looks OK.

I'll open an unblock request soon.

Thanks,

-- 
Sergio
GPG key ID: 237A 54B1 0287 28BF 00EF  31F4 D0EB 7628 65FC 5E36
Please send encrypted e-mail if possible
http://sergiodj.net/

diff --git a/debian/changelog b/debian/changelog
index e19e631..166519b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+ipywidgets (6.0.0-3.1) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * Use 'Object.prototype' instead of 'path.scope.getBindings' when
+    calling 'hasOwnProperty'.  (Closes: #926802)
+
+ -- Sergio Durigan Junior <sergiodj at debian.org>  Sat, 27 Apr 2019 14:47:09 -0400
+
 ipywidgets (6.0.0-3) unstable; urgency=medium
 
   [ Ondřej Nový ]
diff --git a/debian/fakewebpack-postprocess.js b/debian/fakewebpack-postprocess.js
index e7f7dbc..8126eef 100755
--- a/debian/fakewebpack-postprocess.js
+++ b/debian/fakewebpack-postprocess.js
@@ -127,7 +127,7 @@ var transform = function transform(ast, fn, moduleList) {
               && injectGlobalsReplace.hasOwnProperty(path.node.name)
               && (parent.type !== 'MemberExpression' || parent.object === path.node)
               && (parent.type !== 'Property' || parent.value === path.node)) {
-                if (!path.scope.getBindings().hasOwnProperty(path.node.name)) {
+                if (!Object.prototype.hasOwnProperty.call(path.scope.getBindings(), path.node.name)) {
                     injectGlobals.push(path.node.name);
                 }
             }
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/python-modules-team/attachments/20190427/b824cad5/attachment.sig>


More information about the Python-modules-team mailing list