jenkins-bot merged this change.
[bugfix] Fix error thrown on saving user-passwords.py
"AttributeError: module 'pywikibot' has no attribute 'tools'"
Change-Id: I2867d185dd7a8f7bc99d5eec713df54deface921
---
M generate_user_files.py
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/generate_user_files.py b/generate_user_files.py
index 87562fb..916d5b3 100755
--- a/generate_user_files.py
+++ b/generate_user_files.py
@@ -18,6 +18,8 @@
from generate_family_file import _import_with_no_user_config
+from pywikibot.tools import file_mode_checker
+
# DISABLED_SECTIONS cannot be copied; variables must be set manually
DISABLED_SECTIONS = {'USER INTERFACE SETTINGS', # uses sys
'EXTERNAL EDITOR SETTINGS', # uses os
@@ -378,11 +380,10 @@
# in it
with codecs.open(_fncpass, 'w', 'utf-8') as f:
f.write('')
- pywikibot.tools.file_mode_checker(_fncpass, mode=0o600,
- quiet=True)
+ file_mode_checker(_fncpass, mode=0o600, quiet=True)
with codecs.open(_fncpass, 'w', 'utf-8') as f:
f.write(PASSFILE_CONFIG.format(botpasswords=botpasswords))
- pywikibot.tools.file_mode_checker(_fncpass, mode=0o600)
+ file_mode_checker(_fncpass, mode=0o600)
pywikibot.output("'{0}' written.".format(_fncpass))
except EnvironmentError:
os.remove(_fncpass)
To view, visit change 499874. To unsubscribe, or for help writing mail filters, visit settings.