jenkins-bot submitted this change.
[bugfix] ignore variables imported from __future__
Bug: T259285
Change-Id: I6e9fb0869df810702812b2239c3224c8c3309850
---
M generate_user_files.py
M pywikibot/config2.py
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/generate_user_files.py b/generate_user_files.py
index 701b670..1e6a325 100755
--- a/generate_user_files.py
+++ b/generate_user_files.py
@@ -167,8 +167,6 @@
EXTENDED_CONFIG = """# -*- coding: utf-8 -*-
-from __future__ import absolute_import, division, unicode_literals
-
# This is an automatically generated file. You can find more configuration
# parameters in 'config.py' file.
diff --git a/pywikibot/config2.py b/pywikibot/config2.py
index 49482d5..3fd95a6 100644
--- a/pywikibot/config2.py
+++ b/pywikibot/config2.py
@@ -110,6 +110,7 @@
'line_separator', 'LS', 'panoramio', 'proxy', 'special_page_limit',
'sysopnames', 'use_mwparserfromhell', 'use_SSL_onlogin', 'use_SSL_always',
}
+_future_variables = {'absolute_import', 'division', 'unicode_literals'}
# ############# ACCOUNT SETTINGS ##############
@@ -1062,7 +1063,7 @@
if name in _deprecated_variables:
warn('\n' + fill(DEPRECATED_VARIABLE.format(name)),
_ConfigurationDeprecationWarning)
- else:
+ elif name not in _future_variables:
warn('\n'
+ fill('Configuration variable "{0}" is defined in your '
'user-config.py but unknown. It can be a '
To view, visit change 617511. To unsubscribe, or for help writing mail filters, visit settings.