[issue12920] inspect.getsource fails to get source of local classes

2013-03-23 Thread Richard Eames
Changes by Richard Eames naddi...@gmail.com: -- nosy: +Naddiseo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12920 ___ ___ Python-bugs-list

[issue12920] inspect.getsource fails to get source of local classes

2011-09-10 Thread Popa Claudiu
Popa Claudiu pcmantic...@gmail.com added the comment: I forgot to mention that I executed this code directly in IDLE. It seems to work perfectly on command line though. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12920

[issue12920] inspect.getsource fails to get source of local classes

2011-09-09 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: inspect.getsource called with a class defined in the same file fails with TypeError: module '__main__' (built-in) is a built-in class The error message makes me think that getsource(__main__) was used, not getsource(SomeClass). Can you check

[issue12920] inspect.getsource fails to get source of local classes

2011-09-09 Thread Popa Claudiu
Popa Claudiu pcmantic...@gmail.com added the comment: Yes. On Python 3.2 (r32:88445, Feb 20 2011, 21:29:02) [MSC v.1500 32 bit (Intel)] on win32, the result for the following lines: import inspect class A: pass inspect.getsource(A) is: Traceback (most recent call last): File

[issue12920] Inspect.getsource fails to get source of local classes

2011-09-06 Thread Popa Claudiu
New submission from Popa Claudiu pcmantic...@gmail.com: inspect.getsource called with a class defined in the same file fails with TypeError: module '__main__' (built-in) is a built-in class, although the documentation says that: The argument may be a module, class, method, function, traceback,