Last active
August 29, 2015 14:18
-
-
Save priyankajayaswal1/68b7f230de3b50143fd0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/scripts/replace.py b/scripts/replace.py | |
index 56fcab5..c8f16d0 100644 | |
--- a/scripts/replace.py | |
+++ b/scripts/replace.py | |
@@ -803,13 +803,15 @@ def main(*args): | |
if replacement_file: | |
try: | |
with codecs.open(replacement_file, 'r', 'utf-8') as f: | |
- commandline_replacements.extend( | |
- line.lstrip(u'\uFEFF').rstrip('\r\n') for line in f) | |
+ lines = f.readlines() | |
except (IOError, OSError) as e: | |
pywikibot.error('Error loading {0}: {1}'.format( | |
replacement_file, e)) | |
return False | |
+ commandline_replacements.extend( | |
+ line.lstrip(u'\uFEFF').rstrip('\r\n') for line in lines) | |
+ | |
if len(commandline_replacements) % 2: | |
pywikibot.error( | |
'{0} contains an incomplete pattern replacement pair.'.format( | |
(END) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment