Commit fda2ffa5 authored by Jérome Perrin's avatar Jérome Perrin Committed by Levin Zimmermann

pylint: fix KeyError: <type 'numpy.ufunc'> visible with pandas 0.24.2

Updating pandas to 0.24.2 revealed as :

      File "develop-eggs/astroid-1.3.8+slapospatched001-py2.7.egg/astroid/raw_building.py", line 360, in _set_proxied
        return _CONST_PROXY[const.value.__class__]
    KeyError: <type 'numpy.ufunc'>

when linting code referencing pandas. The problem is actually with
some numpy `ufunc`, such as numpy.sin, but we don't seem to have code
using it in the test suite.
parent 6d29c46a
...@@ -391,6 +391,11 @@ else: ...@@ -391,6 +391,11 @@ else:
_register_module_extender_from_live_module('xmlsec.tree', xmlsec.tree) _register_module_extender_from_live_module('xmlsec.tree', xmlsec.tree)
_register_module_extender_from_live_module('xmlsec.template', xmlsec.template) _register_module_extender_from_live_module('xmlsec.template', xmlsec.template)
import numpy.core
_register_module_extender_from_live_module('numpy.core.umath', numpy.core.umath)
# Properly search for namespace packages: original astroid (as of 1.3.8) only # Properly search for namespace packages: original astroid (as of 1.3.8) only
# checks at top-level and it doesn't work for Shared.DC.ZRDB (defined in # checks at top-level and it doesn't work for Shared.DC.ZRDB (defined in
# Products.ZSQLMethods; Shared and Shared.DC being a namespace package defined # Products.ZSQLMethods; Shared and Shared.DC being a namespace package defined
......
...@@ -2319,6 +2319,11 @@ def xmlsec_decrypt(): ...@@ -2319,6 +2319,11 @@ def xmlsec_decrypt():
decrypted = enc_ctx.decrypt(enc_data) decrypted = enc_ctx.decrypt(enc_data)
print(lxml.etree.tostring(decrypted)) print(lxml.etree.tostring(decrypted))
import numpy
numpy.sin([])
import pandas
pandas.DataFrame([])
""" % (dict(namespace=namespace, """ % (dict(namespace=namespace,
reference1=imported_reference1, reference1=imported_reference1,
module2=imported_module2, module2=imported_module2,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment