Skip to content

Commit 20e8562

Browse files
committed
restore pre python 2.5 compatibility
1 parent 016159e commit 20e8562

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/robotremoteserver.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,9 @@ def _handle_binary_args(self, args, kwargs):
129129
return args, kwargs
130130

131131
def _handle_binary_arg(self, arg):
132-
return arg if not isinstance(arg, Binary) else str(arg)
132+
if isinstance(arg, Binary):
133+
return arg.data
134+
return arg
133135

134136
def get_keyword_arguments(self, name):
135137
kw = self._get_keyword(name)
@@ -230,7 +232,9 @@ def _str(self, item, handle_binary=True):
230232
return ''
231233
if not isinstance(item, basestring):
232234
item = unicode(item)
233-
return self._handle_binary_result(item) if handle_binary else item
235+
if handle_binary:
236+
return self._handle_binary_result(item)
237+
return item
234238

235239
def _intercept_std_streams(self):
236240
sys.stdout = StringIO()

0 commit comments

Comments
 (0)