jenkins-bot merged this change.

View Change

Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
Fix regression in generate_user_files.py and generate_family_file.py

The regression was introduced in d3cd1f4e9904e153ac58ca6d12d5c2f57a44d1a3.

Change-Id: Iebc7188f387c7860122417a23925a2432d68d126
---
M generate_family_file.py
M generate_user_files.py
2 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/generate_family_file.py b/generate_family_file.py
index 80a62d2..2abb768 100755
--- a/generate_family_file.py
+++ b/generate_family_file.py
@@ -15,8 +15,6 @@
import os
import sys

-from pywikibot.site_detect import MWSite as Wiki
-
# creating & retrieving urls
if sys.version_info[0] > 2:
from urllib.parse import urlparse
@@ -24,11 +22,11 @@
else:
from urlparse import urlparse

-
# Disable user-config checks so the family can be created first,
# and then used when generating the user-config
_orig_no_user_config = os.environ.get('PYWIKIBOT2_NO_USER_CONFIG')
os.environ['PYWIKIBOT2_NO_USER_CONFIG'] = '2'
+from pywikibot.site_detect import MWSite as Wiki # noqa: E402

# Reset this flag in case another script is run by pwb after this script
if not _orig_no_user_config:
diff --git a/generate_user_files.py b/generate_user_files.py
index 6ddb9f6..0f46b8c 100755
--- a/generate_user_files.py
+++ b/generate_user_files.py
@@ -17,13 +17,11 @@
from textwrap import fill
from warnings import warn

-import pywikibot
-from pywikibot import config
-
-
# Disable user-config usage as we are creating it here
_orig_no_user_config = os.environ.get('PYWIKIBOT2_NO_USER_CONFIG')
os.environ['PYWIKIBOT2_NO_USER_CONFIG'] = '2'
+import pywikibot # noqa: E402
+from pywikibot import config # noqa: E402

# Reset this flag in case another script is run by pwb after this script
if not _orig_no_user_config:

To view, visit change 430835. To unsubscribe, visit settings.

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Iebc7188f387c7860122417a23925a2432d68d126
Gerrit-Change-Number: 430835
Gerrit-PatchSet: 4
Gerrit-Owner: Dalba <dalba.wiki@gmail.com>
Gerrit-Reviewer: Dalba <dalba.wiki@gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb@gmail.com>
Gerrit-Reviewer: Xqt <info@gno.de>
Gerrit-Reviewer: Zoranzoki21 <zorandori4444@gmail.com>
Gerrit-Reviewer: jenkins-bot <>