Here is the simple code:
import sys class EmptyArgs(StandardError): pass if __name__ == "__main__": # The first way to raise an exception if len(sys.argv) == 1: raise EmptyArgs # The second way to raise an exception if len(sys.argv) == 1: raise EmptyArgs() Which way is "more" correct? Both are working. Note: In my real code, the exception is exactly the same as I declared: without a message and arguments.