Skip to content

Commit

Permalink
Merge pull request #175 from xenserver-next/Python3-Fix-InternalError…
Browse files Browse the repository at this point in the history
…-Creation

src/lib/pythongen.ml: Fix InternalError(str(exception)) for Py3
  • Loading branch information
mseri authored Jun 27, 2023
2 parents 13ff10a + e7054a8 commit cbcdec7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/lib/pythongen.ml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ class ListAction(argparse.Action):


let compat_block =
[ Line "if sys.version_info[0] > 2:"
[ Line "get_str = str"
; Line "if sys.version_info[0] > 2:"
; Block [ Line "long = int"; Line "unicode = str"; Line "str = bytes" ]
; Line ""
]
Expand Down Expand Up @@ -847,7 +848,7 @@ let of_interfaces ?(helpers = inline_defaults) i =
; Block
[ Line {|logging.log("caught %s", exn)|}
; Line "traceback.print_exc()"
; Line "return InternalError(str(exn)).failure()"
; Line "return InternalError(get_str(exn)).failure()"
]
]
]
Expand Down

0 comments on commit cbcdec7

Please sign in to comment.