As quick as ever Dino. :-)

Thanks

Michael

Dino Viehland wrote:
runpy is setting __package__ to an empty string.  Looks like CPython doesn't
warn when the string is empty because if I do:

import runpy
x = runpy.run_module('foo', run_name = '__main__', alter_sys=True)

CPython doesn't warn. So the fix is easy enough.

But it's interesting CPython no longer calls runpy.run_module anymore. I
guess it's calling runpy._run_module_as_main as there's a big comment saying
should we make this public.

-----Original Message-----
From: [email protected] [mailto:users-
[email protected]] On Behalf Of Michael Foord
Sent: Friday, August 21, 2009 3:40 PM
To: Discussion of IronPython
Subject: [IronPython] Spurious warning when executing modules with -m

Create a Python file called foo.py containing nothing but "import os".
Execute it with "python -m foo" and "ipy.exe -m foo" (Python 2.6 and
IronPython 2.6 B2).

C:\compile\testing>python -m foo

C:\compile\testing>ipy.exe -m foo
<string>:1: RuntimeWarning: Parent module '' not found while handling
absolute import

Michael

--
http://www.ironpythoninaction.com/
http://www.voidspace.org.uk/blog


_______________________________________________
Users mailing list
[email protected]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

_______________________________________________
Users mailing list
[email protected]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


--
http://www.ironpythoninaction.com/
http://www.voidspace.org.uk/blog


_______________________________________________
Users mailing list
[email protected]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Reply via email to