Skip to content
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

Closed
wants to merge 1 commit into from
Closed

Fix Python 3 pylint errors #594

wants to merge 1 commit into from

Conversation

tiran
Copy link
Member

@tiran tiran commented Mar 15, 2017

************* 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

@tiran tiran mentioned this pull request Mar 15, 2017
5 tasks
@@ -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):
Copy link
Contributor

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.

Copy link
Member Author

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'

Copy link
Member Author

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.

@tiran tiran force-pushed the pylint_py3 branch 2 times, most recently from db76394 to 31b7eed Compare March 15, 2017 10:50
************* 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>
@tiran
Copy link
Member Author

tiran commented Mar 15, 2017

@stlaz I fixed the problem with shadowed builtin type type.

Copy link
Contributor

@simo5 simo5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@simo5 simo5 added the ack Pull Request approved, can be merged label Mar 15, 2017
@MartinBasti
Copy link
Contributor

master:

  • 602b395 Fix Python 3 pylint errors

@MartinBasti MartinBasti added the pushed Pull Request has already been pushed label Mar 15, 2017
@tiran tiran deleted the pylint_py3 branch March 15, 2017 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ack Pull Request approved, can be merged pushed Pull Request has already been pushed
Projects
None yet
4 participants