jenkins-bot submitted this change.
[bugfix] import dependecies at top of a script file
Bug: T302774
Change-Id: I939757ea3498927d3df949a478706c472a0a9643
---
M pywikibot/page/__init__.py
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/pywikibot/page/__init__.py b/pywikibot/page/__init__.py
index 536c5cb..f3db6ea 100644
--- a/pywikibot/page/__init__.py
+++ b/pywikibot/page/__init__.py
@@ -30,9 +30,10 @@
from warnings import warn
import pywikibot
-from pywikibot import config, i18n, textlib
+from pywikibot import config, date, i18n, textlib
from pywikibot.backports import Dict, Generator, Iterable, List, Tuple
from pywikibot.comms import http
+from pywikibot.cosmetic_changes import CANCEL, CosmeticChangesToolkit
from pywikibot.exceptions import (
APIError,
AutoblockUserError,
@@ -405,7 +406,6 @@
same names. Regular titles return (None, None).
"""
if not hasattr(self, '_autoFormat'):
- from pywikibot import date
self._autoFormat = date.getAutoFormat(
self.site.lang,
self.title(with_ns=False)
@@ -1266,7 +1266,6 @@
pywikibot.log('Cosmetic changes for {}-{} enabled.'
.format(family, self.site.lang))
# cc depends on page directly and via several other imports
- from pywikibot.cosmetic_changes import CANCEL, CosmeticChangesToolkit
cc_toolkit = CosmeticChangesToolkit(self, ignore=CANCEL.MATCH)
self.text = cc_toolkit.change(old)
To view, visit change 767210. To unsubscribe, or for help writing mail filters, visit settings.