Skip to content
Permalink
Browse files

change isShellBuiltin

change isShellBuiltin to have each builtin as a different token in a set and lookup cmd to be an element of the set instead of a sequence of characters in a string (tested only on Python 3.6.7). Corrected according to @lantz comments.
  • Loading branch information...
dsaucez committed Apr 23, 2019
1 parent c5f23b9 commit 7c0d1506e7b75c213080e99ff1a520b914018c1d
Showing with 1 addition and 1 deletion.
  1. +1 −1 mininet/util.py
@@ -181,7 +181,7 @@ def which(cmd, **kwargs ):
def isShellBuiltin( cmd ):
"Return True if cmd is a bash builtin."
if isShellBuiltin.builtIns is None:
isShellBuiltin.builtIns = quietRun( 'bash -c enable' )
isShellBuiltin.builtIns = set(quietRun( 'bash -c enable' ).split())
space = cmd.find( ' ' )
if space > 0:
cmd = cmd[ :space]

0 comments on commit 7c0d150

Please sign in to comment.
You can’t perform that action at this time.