Skip to content

Commit

Permalink
py3: make sure we are not using unicode type in python3
Browse files Browse the repository at this point in the history
This uses the same mechanism as ac683ca.

Signed-off-by: Yann Dirson <[email protected]>
  • Loading branch information
ydirson committed Jan 31, 2024
1 parent f5df300 commit 7c20b0a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
10 changes: 9 additions & 1 deletion ocaml/xapi-storage/python/xapi/storage/api/datapath.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@
import argparse
import traceback
import logging

# pylint: disable=invalid-name,redefined-builtin,undefined-variable
# pyright: reportUndefinedVariable=false
if sys.version_info[0] > 2:
long = int
unicode = str
str = bytes

class Unimplemented(Rpc_light_failure):
def __init__(self, arg_0):
Rpc_light_failure.__init__(self, "Unimplemented", [ arg_0 ])
Expand Down Expand Up @@ -398,4 +406,4 @@ def _dispatch(self, method, params):
class datapath_server_test(datapath_server_dispatcher):
"""Create a server which will respond to all calls, returning arbitrary values. This is intended as a marshal/unmarshal test."""
def __init__(self):
datapath_server_dispatcher.__init__(self, Datapath_server_dispatcher(Datapath_test()))
datapath_server_dispatcher.__init__(self, Datapath_server_dispatcher(Datapath_test()))
10 changes: 9 additions & 1 deletion ocaml/xapi-storage/python/xapi/storage/api/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@
import argparse
import traceback
import logging

# pylint: disable=invalid-name,redefined-builtin,undefined-variable
# pyright: reportUndefinedVariable=false
if sys.version_info[0] > 2:
long = int
unicode = str
str = bytes

class Unimplemented(Rpc_light_failure):
def __init__(self, arg_0):
Rpc_light_failure.__init__(self, "Unimplemented", [ arg_0 ])
Expand Down Expand Up @@ -230,4 +238,4 @@ def _dispatch(self, method, params):
class plugin_server_test(plugin_server_dispatcher):
"""Create a server which will respond to all calls, returning arbitrary values. This is intended as a marshal/unmarshal test."""
def __init__(self):
plugin_server_dispatcher.__init__(self, Plugin_server_dispatcher(Plugin_test()))
plugin_server_dispatcher.__init__(self, Plugin_server_dispatcher(Plugin_test()))

0 comments on commit 7c20b0a

Please sign in to comment.