use isinstance( obj, basestring) to allow unicode strings

fixes #448
This commit is contained in:
Bob Lantz
2014-11-23 10:59:08 -08:00
parent f0f9907b9d
commit 9a8bdfd765
4 changed files with 11 additions and 11 deletions
+3 -3
View File
@@ -355,7 +355,7 @@ class Node( object ):
if type( args[ 0 ] ) is list:
# popen([cmd, arg1, arg2...])
cmd = args[ 0 ]
elif type( args[ 0 ] ) is str:
elif isinstance( args[ 0 ], basestring ):
# popen("cmd arg1 arg2...")
cmd = args[ 0 ].split()
else:
@@ -432,7 +432,7 @@ class Node( object ):
"""
if not intf:
return self.defaultIntf()
elif type( intf ) is str:
elif isinstance( intf, basestring):
return self.nameToIntf[ intf ]
else:
return intf
@@ -484,7 +484,7 @@ class Node( object ):
"""Set the default route to go through intf.
intf: Intf or {dev <intfname> via <gw-ip> ...}"""
# Note setParam won't call us if intf is none
if type( intf ) is str and ' ' in intf:
if isinstance( intf, basestring ) and ' ' in intf:
params = intf
else:
params = 'dev %s' % intf