#!/usr/bin/python
str = "this"
if(1):
print "Hi"
else:
print str.any_random_function()
This doesn't fail when I run the program. I tried py_compile but that didn't indicate the error in the else loop either. Now how can I compile the program and detect errors reliably in python code?
any_random_functionis properly defined for the built-in string class.