New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Python 3 pylint errors #594
Conversation
ipapython/install/core.py
Outdated
| @@ -160,7 +159,7 @@ def _knob(type=_missing, default=_missing, bases=_missing, _order=_missing, | |||
|
|
|||
| if bases is _missing: | |||
| bases = (KnobBase,) | |||
| elif isinstance(bases, types.TypeType): | |||
| elif isinstance(bases, type): | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will break the code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it's the same thing since Python 2.2 and has been removed from Python 3:
$ python2.7
>>> import types
>>> types.TypeType is type
True
$ python3.5
>>> import types
>>> types.TypeType is type
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: module 'types' has no attribute 'TypeType'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
argh! the function shadows the builtin type.
db76394
to
31b7eed
Compare
************* Module ipaserver.install.ipa_kra_install ipaserver/install/ipa_kra_install.py:25: [W0402(deprecated-module), ] Uses of a deprecated module 'optparse') ************* Module ipapython.install.core ipapython/install/core.py:163: [E1101(no-member), _knob] Module 'types' has no 'TypeType' member) ************* Module ipatests.test_ipapython.test_dn ipatests/test_ipapython/test_dn.py:1205: [W1505(deprecated-method), TestDN.test_x500_text] Using deprecated method assertEquals()) ************* Module ipa-ca-install install/tools/ipa-ca-install:228: [E1101(no-member), install_master] Instance of 'ValueError' has no 'message' member) install/tools/ipa-ca-install:232: [E1101(no-member), install_master] Instance of 'ValueError' has no 'message' member) Signed-off-by: Christian Heimes <cheimes@redhat.com>
|
@stlaz I fixed the problem with shadowed builtin type |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
master:
|
Signed-off-by: Christian Heimes cheimes@redhat.com