|
11 | 11 | oneResult = multireturn.SingleWithoutErrorFunc()
|
12 | 12 | print("Single WithoutError Return %r" % oneResult)
|
13 | 13 |
|
| 14 | +############### Single Str WithoutError Return ############## |
| 15 | +oneStrResult = multireturn.SingleStrWithoutErrorFunc() |
| 16 | +print("Single Str WithoutError Return %r" % oneStrResult) |
| 17 | + |
14 | 18 | ############### Single WithError Return ##############
|
15 | 19 | errorFalseResult = multireturn.SingleWithErrorFunc(False)
|
16 | 20 | print("Single WithError(False) Return %r" % errorFalseResult)
|
17 | 21 |
|
18 |
| -errorTrueResult = multireturn.SingleWithErrorFunc(True) |
19 |
| -print("Single WithError(True) Return %r" % errorTrueResult) |
| 22 | +try: |
| 23 | + errorTrueResult = multireturn.SingleWithErrorFunc(True) |
| 24 | + print("Failed to throw an exception") |
| 25 | +except RuntimeError as ex: |
| 26 | + print("Single WithError(True). Exception:%r" % ex) |
20 | 27 |
|
21 | 28 | ############### Double WithoutError Return ##############
|
22 | 29 | twoResults = multireturn.DoubleWithoutErrorFunc()
|
23 |
| -print("Double WithoutError Return %r" % twoResults) |
| 30 | +print("Double WithoutError Return (%r, %r)" % twoResults) |
24 | 31 |
|
25 | 32 | ############### Double WithError Return ##############
|
26 |
| -(value400, errorTrueResult) = multireturn.DoubleeWithErrorFunc(True) |
27 |
| -print("Double WithError(True) Return (%r, %r)" % (value400, errorTrueResult)) |
| 33 | +try: |
| 34 | + value400 = multireturn.DoubleWithErrorFunc(True) |
| 35 | + print("Failed to throw an exception. Return (%r, %r)." % value400) |
| 36 | +except RuntimeError as ex: |
| 37 | + print("Double WithError(True). exception Return %r" % ex) |
28 | 38 |
|
29 |
| -(value500, errorFalseResult) = multireturn.DoubleWithErrorFunc(False) |
30 |
| -print("Double WithError(False) Return (%r, %r)" % (value500, errorFalseResult)) |
| 39 | +value500 = multireturn.DoubleWithErrorFunc(False) |
| 40 | +print("Double WithError(False) Return %r" % value500) |
31 | 41 |
|
32 | 42 | ############### Triple Without Error Return ##############
|
33 |
| -threeResults = multireturn.TripleWithoutErrorFunc() |
34 |
| -print("Triple WithoutError Return %r" % threeResult) |
| 43 | +threeResults = multireturn.TripleWithoutErrorFunc1() |
| 44 | +print("Triple WithoutError(Without String) Return (%r, %r, %r)" % threeResults) |
| 45 | + |
| 46 | +threeResults = multireturn.TripleWithoutErrorFunc2() |
| 47 | +print("Triple WithoutError(With String) Return (%r, %r, %r)" % threeResults) |
35 | 48 |
|
36 | 49 | ############### Triple With Error Return ##############
|
37 |
| -(value900, value1000, errorTrueResult) = multireturn.TripleWithErrorFunc(True) |
38 |
| -print("Triple WithError(True) Return (%r, %r, %r)" % (value900, value1000, errorFalseResult)) |
| 50 | +try: |
| 51 | + (value900, value1000, errorTrueResult) = multireturn.TripleWithErrorFunc(True) |
| 52 | +except RuntimeError as ex: |
| 53 | + print("Triple WithError(True). exception Return %r" % ex) |
39 | 54 |
|
40 |
| -(value1100, value1200, errorFalseResult) = multireturn.TripleWithErrorFunc(False) |
41 |
| -print("Triple WithError(False) Return (%r, %r, %r)" % (value1100, value1200, errorFalseResult)) |
| 55 | +(value1100, value1200) = multireturn.TripleWithErrorFunc(False) |
| 56 | +print("Triple WithError(False) Return (%r, %r)" % (value1100, value1200)) |
42 | 57 |
|
43 | 58 | ############### Triple Struct Return With Error ##############
|
44 | 59 | (ptr1300, struct1400, errorTrueResult) = multireturn.TripleWithStructWithErrorFunc(True)
|
|
0 commit comments