Hi,
 
I get an IO error when executing some code based on the inspect module:
 
import inspect
 
def FunctionTest():
    x = 1
    y = 2
    return x+1
 
stringFunction = inspect.getsource(FunctionTest)
    
print stringFunction

 
# ERROR : Traceback (most recent call last):
#   File "<Script Block >", line 8, in <module>
#     stringFunction = inspect.getsource(FunctionTest)
#   File "C:\Python25\Lib\inspect.py", line 614, in getsource
#     lines, lnum = getsourcelines(object)
#   File "C:\Python25\Lib\inspect.py", line 603, in getsourcelines
#     lines, lnum = findsource(object)
#   File "C:\Python25\Lib\inspect.py", line 468, in findsource
#     raise IOError('could not get source code')
# IOError: could not get source code
#  - [line 8]

The script is invoked through the pywin ActiveX engine 
IActiveScriptParse::ParseScriptText.
 
Any ideas what is going on?
 
thanks
 
-mab
_______________________________________________
Python-win32 mailing list
Python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to