End Of File Error while taking input from the user

I run this code spyder ide and its working perfectly fine and giving me exact output as i wanted but when i run this code here EOFError occurs at line 4 where i take input from user.
sum1 = 0
pos_num = []
while(True):
n = int(raw_input())
sum1 = sum1+n
if(sum1>=0):
pos_num.append(n)
else:
break

for i in range(len(pos_num)):
print(pos_num[i])