Skip to content
← Back to Community
repl process died unexpectedly
Profile icon
shlobb13

could someone help with this error msg? TIA

import sys

while True:
print('Type exit to exit.')
response = input()
if response == 'exit':
sys.exit()
print('You typed ' + response + '.')

Voters
Profile icon
IgorMonteiro4
Profile icon
11irishjs
Profile icon
Bchamps
Profile icon
GiulianoFilters
Profile icon
shlobb13
Comments
hotnewtop
Profile icon
CodingRobot12

It isn't an error message. This is supposed to appear whenever you write the command sys.exit()

Profile icon
WaruchJiratanak

I think it's supposed to do that.

Profile icon
CodeLongAndPros

It's not an error, I believe that the exit code was given before it was expected, if you press C-d in the repl, it'll give that as well.

Profile icon
Bookie0

first of all that isnt an error message. It just says that because you told the repl to quit with sys.exit() which means the program exits. If you dont want this, since this is a while True statement, instead of sys.exit(), use break which will do the same.

Happy coding and hope this helps! =)

Profile icon
shlobb13

thanks all

Profile icon
[deleted]

Like the others said, that isn't an error messages. That just means the repl process died before it thought it was supposed to. It does that to me pretty much any time I use a sys.exit() command.