Python Beta exit infinity lopp

Problem description:
I found a bug (only in Python Beta Template). Basically an infinity exit loop. (and then the console literally says “Giving Up.” lol)

def this_never_existed(unreal_function):
  def wrapper(*args, **kwargs):
    exit('This function never existed lol')

  return wrapper

@this_never_existed
def greet(name):
  print(f'Hello, {name}!')

greet('John')

Expected behavior:
A single exit message

Actual behavior:
image

Steps to reproduce:

  1. Make Python (Beta) repl
  2. do the code above
  3. run repl

Bug appears at this link:
https://replit.com/@SnakeyKing/test#main.py

Browser/OS/Device:
Edge/Windows/Computer

1 Like

I wouldn’t call this a bug. This is a much better improvement when compared to letting CPU power run out and Python crashing altogether.

Wait, edit: I reread your post, and its looping exit()? How is that even possible? That actually might be a bug, whether intended or not, that would easily break programs that migrated to it and used exit() within their code. (Hopefully this is what you mean lol)

3 Likes

I actually like this bug, because it’s dramatic and funny.

1 Like

Funny! I guess the Replit template keeps trying to recover or something.

3 Likes