Skip to content

Commit 40f1209

Browse files
committed
Fix python2 and unicode quoting
1 parent d2205b4 commit 40f1209

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

stormshield/sns/sslclient/__init__.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,12 @@ def __bool__(self):
124124

125125
def quote(value):
126126
""" Quote value if needed """
127-
if value and type(value) == str and ' ' in value:
128-
return '"' + value + '"'
127+
try:
128+
if value and (type(value) == str or type(value) == unicode) and ' ' in value:
129+
return '"' + value + '"'
130+
except:
131+
# in python3 unicode class doesn't exists
132+
pass
129133
return value
130134

131135
def format_output(output):

0 commit comments

Comments
 (0)