Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,4 @@
import exceptions
class SillyError(exceptions.Exception):
def __init__(self,args=None):
self.args=args

View file

@ -0,0 +1,2 @@
class MyInvalidArgument(ValueError):
pass

View file

@ -0,0 +1,2 @@
def spam():
raise SillyError # equivalent to raise SillyError()

View file

@ -0,0 +1,2 @@
def spam():
raise SillyError, 'egg' # equivalent to raise SillyError('egg')

View file

@ -0,0 +1,2 @@
def spam():
raise SillyError('egg')

View file

@ -0,0 +1,10 @@
try:
foo()
except SillyError, se:
print se.args
bar()
else:
# no exception occurred
quux()
finally:
baz()

View file

@ -0,0 +1,10 @@
try:
foo()
except SillyError as se:
print(se.args)
bar()
else:
# no exception occurred
quux()
finally:
baz()