jenkins-bot has submitted this change. ( 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/642817 )

Change subject: [bugfix] define availableOptions as deprecated property
......................................................................

[bugfix] define availableOptions as deprecated property

- Define availableOptions as deprecated property instead of classproperty.
  Otherwise redefinition of available_options as instance attribute instead
  of class attribute will fail in set_options method later.

Change-Id: Ie752df9952579e4ebf525da1e6ff2c53516f8bf9
---
M pywikibot/bot.py
1 file changed, 5 insertions(+), 7 deletions(-)

Approvals:
  JJMC89: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/pywikibot/bot.py b/pywikibot/bot.py
index b2be383..82fc233 100644
--- a/pywikibot/bot.py
+++ b/pywikibot/bot.py
@@ -119,15 +119,13 @@
 from pywikibot.logging import DEBUG, INPUT, STDOUT, VERBOSE
 from pywikibot.logging import (
     add_init_routine,
-    debug, error, exception, log, output, stdout, warning,
+    critical, debug, error, exception, log, output, stdout, warning,
 )
-from pywikibot.logging import critical
 from pywikibot.tools import (
     deprecated, deprecate_arg, deprecated_args, issue_deprecation_warning,
-    PYTHON_VERSION,
+    PYTHON_VERSION, suppress_warnings
 )
 from pywikibot.tools._logging import LoggingFormatter, RotatingFileHandler
-from pywikibot.tools import classproperty, suppress_warnings
 from pywikibot.tools.formatter import color_format

 if PYTHON_VERSION >= (3, 9):
@@ -1091,11 +1089,11 @@
         """
         self.set_options(**kwargs)

-    @classproperty
+    @property
     @deprecated('available_options', since='20201006')
-    def availableOptions(cls):
+    def availableOptions(self):
         """DEPRECATED. Available_options class property."""
-        return cls.available_options
+        return self.available_options

     @deprecated('set_options', since='20201006')
     def setOptions(self, **kwargs):  # pragma: no cover

--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/642817
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.wikimedia.org/r/settings

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: Ie752df9952579e4ebf525da1e6ff2c53516f8bf9
Gerrit-Change-Number: 642817
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <[email protected]>
Gerrit-Reviewer: JJMC89 <[email protected]>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
_______________________________________________
Pywikibot-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot-commits

Reply via email to