Merlijn van Deen has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/76486


Change subject: Updated pwb.py to better mirror direct script runs
......................................................................

Updated pwb.py to better mirror direct script runs

Before, execfile() ran the script in environment that pwb.py has, which
included os and path imports, and several other variables. Now, only
__file__, __name__ and __builtins__ are passed, which should be all that
is needed.

After this change, the effects of changeset 76484 can be seen using pwb.py

Change-Id: If9458fca50f07f08441dbb6e06f78bdbae2065de
---
M pwb.py
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/86/76486/1

diff --git a/pwb.py b/pwb.py
index 0327ab1..5f608bc 100644
--- a/pwb.py
+++ b/pwb.py
@@ -47,6 +47,6 @@
             else:
                 raise Exception("%s not found!" % sys.argv[0]) 
     sys.path.append(os.path.split(sys.argv[0])[0])
-    execfile(sys.argv[0])
+    execfile(sys.argv[0], {'__name__': '__main__', '__builtins__': 
__builtins__, '__file__': sys.argv[0]})
 else:
     sys.argv.append('')

-- 
To view, visit https://gerrit.wikimedia.org/r/76486
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If9458fca50f07f08441dbb6e06f78bdbae2065de
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Merlijn van Deen <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to