jenkins-bot has submitted this change and it was merged.

Change subject: [FEAT] Always use function.__name__
......................................................................


[FEAT] Always use function.__name__

According to the Python documentation [1] function.__name__ was
already introduced in Python 2.6, so the if-condition added in
8f1a9b77697e941efd918e03a00380fc98416836 is true always.

[1]: https://docs.python.org/2/reference/datamodel.html#index-36

Change-Id: I827af43a8de64be439f2acf5f800be9ae9c7fc59
---
M pywikibot/tools.py
1 file changed, 1 insertion(+), 5 deletions(-)

Approvals:
  Merlijn van Deen: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/pywikibot/tools.py b/pywikibot/tools.py
index 61c5b7a..26c56fb 100644
--- a/pywikibot/tools.py
+++ b/pywikibot/tools.py
@@ -337,11 +337,7 @@
     class Wrapper(object):
         def __init__(self, function, source, target):
             self._function = function
-            if hasattr(function, '__name__'):
-                func_name = function.__name__
-            else:
-                func_name = function.func_name
-            self.parameters = {'new': func_name,
+            self.parameters = {'new': function.__name__,
                                'target': target,
                                'source': source}
             self.warning = ('{source}{new} is DEPRECATED, use {target}{new} '

-- 
To view, visit https://gerrit.wikimedia.org/r/156271
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I827af43a8de64be439f2acf5f800be9ae9c7fc59
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: XZise <[email protected]>
Gerrit-Reviewer: Ladsgroup <[email protected]>
Gerrit-Reviewer: Merlijn van Deen <[email protected]>
Gerrit-Reviewer: XZise <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
Pywikibot-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot-commits

Reply via email to