[migration] put some migration context info in doctest environment: __file__ and __args__
--- a/migration.py Fri Nov 05 16:55:13 2010 +0100
+++ b/migration.py Tue Nov 09 10:18:56 2010 +0100
@@ -334,14 +334,15 @@
if not self.execscript_confirm(migrscript):
return
scriptlocals = self._create_context().copy()
+ scriptlocals.update({'__file__': migrscript,
+ '__args__': kwargs.pop("scriptargs", [])})
self._context_stack.append(scriptlocals)
if script_mode == 'python':
if funcname is None:
pyname = '__main__'
else:
pyname = splitext(basename(migrscript))[0]
- scriptlocals.update({'__file__': migrscript, '__name__': pyname,
- '__args__': kwargs.pop("scriptargs", [])})
+ scriptlocals['__name__'] = pyname
execfile(migrscript, scriptlocals)
if funcname is not None:
try: