class Bad(Exception):
    def __repr__(self):
        raise RuntimeError("I'm a bad class!")


def a():
    x = Bad()
    return x

def b():
    x = Bad()
    raise x

a()
try:
    b()
except Exception as exc:
    print(exc)

class Bad(Exception):
    __slots__ = []

    def __repr__(self):
        raise RuntimeError("I'm a bad class!")


def a():
    x = Bad()
    return x

def b():
    x = Bad()
    raise x

a()
try:
    b()
except Exception as exc:
    print(exc)

Add __slots__ to satisfy tests (rudimentary_repr is still ordinary __repr__ if __slots__ are there).
Add __slots__ to satisfy tests (rudimentary_repr is still ordinary __repr__ if __slots__ are there).

  class Bad(Exception):
+     __slots__ = []
+ 
      def __repr__(self):
          raise RuntimeError("I'm a bad class!")
  
  
  def a():
      x = Bad()
      return x
  
  def b():
      x = Bad()
      raise x
  
  a()
  try:
      b()
  except Exception as exc:
      print(exc)
  
Add __slots__ to satisfy tests (rudimentary_repr is still ordinary __repr__ if __slots__ are there).
## Code Before:
class Bad(Exception):
    def __repr__(self):
        raise RuntimeError("I'm a bad class!")


def a():
    x = Bad()
    return x

def b():
    x = Bad()
    raise x

a()
try:
    b()
except Exception as exc:
    print(exc)

## Instruction:
Add __slots__ to satisfy tests (rudimentary_repr is still ordinary __repr__ if __slots__ are there).
## Code After:
class Bad(Exception):
    __slots__ = []

    def __repr__(self):
        raise RuntimeError("I'm a bad class!")


def a():
    x = Bad()
    return x

def b():
    x = Bad()
    raise x

a()
try:
    b()
except Exception as exc:
    print(exc)
