| 1 |
try: |
| 2 |
|
| 3 |
str.not_existing |
| 4 |
except TypeError: |
| 5 |
pass |
| 6 |
|
| 7 |
try: |
| 8 |
str.not_existing |
| 9 |
except AttributeError: |
| 10 |
|
| 11 |
str.not_existing |
| 12 |
pass |
| 13 |
|
| 14 |
try: |
| 15 |
import not_existing_import |
| 16 |
except ImportError: |
| 17 |
pass |
| 18 |
try: |
| 19 |
|
| 20 |
import not_existing_import2 |
| 21 |
except AttributeError: |
| 22 |
pass |
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
try: |
| 28 |
str.not_existing |
| 29 |
except (TypeError, AttributeError): pass |
| 30 |
|
| 31 |
try: |
| 32 |
str.not_existing |
| 33 |
except ImportError: |
| 34 |
pass |
| 35 |
except (NotImplementedError, AttributeError): pass |
| 36 |
|
| 37 |
try: |
| 38 |
|
| 39 |
str.not_existing |
| 40 |
except (TypeError, NotImplementedError): pass |
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
|
| 45 |
try: |
| 46 |
str.not_existing |
| 47 |
except ((AttributeError)): pass |
| 48 |
try: |
| 49 |
|
| 50 |
str.not_existing |
| 51 |
except [AttributeError]: pass |
| 52 |
|
| 53 |
|
| 54 |
try: |
| 55 |
pass |
| 56 |
|
| 57 |
except Undefined: |
| 58 |
pass |
| 59 |
|
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
|
| 64 |
try: |
| 65 |
undefined |
| 66 |
except Exception: |
| 67 |
pass |
| 68 |
|
| 69 |
|
| 70 |
try: |
| 71 |
undefined |
| 72 |
except: |
| 73 |
pass |
| 74 |
|
| 75 |
|
| 76 |
|
| 77 |
|
| 78 |
|
| 79 |
if hasattr(str, 'undefined'): |
| 80 |
str.undefined |
| 81 |
str.upper |
| 82 |
|
| 83 |
str.undefined2 |
| 84 |
|
| 85 |
int.undefined |
| 86 |
else: |
| 87 |
str.upper |
| 88 |
|
| 89 |
str.undefined |
| 90 |
|
| 91 |
|
| 92 |
|
| 93 |
|
| 94 |
|
| 95 |
def i_see(r): |
| 96 |
return r |
| 97 |
|
| 98 |
def lala(): |
| 99 |
|
| 100 |
|
| 101 |
a = TypeError |
| 102 |
try: |
| 103 |
i_see() |
| 104 |
except a: |
| 105 |
pass |
| 106 |
|
| 107 |
i_see() |