* Changing all isinstance(STUFF, str)' to isinstance(STUFF, basestring)'

for future-proofing this code.
This commit is contained in:
Wirawan Purwanto
2012-04-13 17:10:32 -04:00
parent 6656d3d5e3
commit 606214eb66
7 changed files with 9 additions and 9 deletions

View File

@@ -186,7 +186,7 @@ else:
This is my customary shortcut for backtick operator.
The result is either a single string (if split==False) or a list of strings
with EOLs removed (if split==True)."""
if shell or isinstance(args, str):
if shell or isinstance(args, basestring):
# BEWARE: args should be a string in this case
p = os.popen(args, "r")
else:
@@ -203,7 +203,7 @@ else:
"""Executes a shell command, piping in the stdin from python for driving.
This is the reverse of pipe_out.
Commands are given through file-like write() or writelines() methods."""
if shell or isinstance(args, str):
if shell or isinstance(args, basestring):
# BEWARE: args should be a string in this case
p = os.popen(args, "w")
else: