Skip to content

Commit

Permalink
replaces isinstance(str) with isinstance(BaseString)
Browse files Browse the repository at this point in the history
  • Loading branch information
gabay committed Nov 15, 2018
1 parent b7a6b81 commit c7a27b8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mininet/util.py
Expand Up @@ -66,7 +66,7 @@ def oldQuietRun( *cmd ):
cmd: list of command params""" cmd: list of command params"""
if len( cmd ) == 1: if len( cmd ) == 1:
cmd = cmd[ 0 ] cmd = cmd[ 0 ]
if isinstance( cmd, str ): if isinstance( cmd, BaseString ):
cmd = cmd.split( ' ' ) cmd = cmd.split( ' ' )
popen = Popen( cmd, stdout=PIPE, stderr=STDOUT ) popen = Popen( cmd, stdout=PIPE, stderr=STDOUT )
# We can't use Popen.communicate() because it uses # We can't use Popen.communicate() because it uses
Expand Down Expand Up @@ -107,7 +107,7 @@ def errRun( *cmd, **kwargs ):
if len( cmd ) == 1: if len( cmd ) == 1:
cmd = cmd[ 0 ] cmd = cmd[ 0 ]
# Allow passing in a list or a string # Allow passing in a list or a string
if isinstance( cmd, str ) and not shell: if isinstance( cmd, BaseString ) and not shell:
cmd = cmd.split( ' ' ) cmd = cmd.split( ' ' )
cmd = [ str( arg ) for arg in cmd ] cmd = [ str( arg ) for arg in cmd ]
elif isinstance( cmd, list ) and shell: elif isinstance( cmd, list ) and shell:
Expand Down

0 comments on commit c7a27b8

Please sign in to comment.