You have a try
with no except
clause. You need something like:
try:
while True:
if (GPIO.input(4) == 1):
print "button pressed"
else:
print "he"
except:
# handle exception here
pass # if you want to ignore it
GPIO.cleanup()