If you really want to patch subprocess, use this:
--- /usr/lib64/python2.6/subprocess.py 2010-11-22 15:03:35.000000000 -0600
+++ /home/schwabacher/subprocess.py 2014-12-18 11:35:10.373428028 -0600
@@ -577,6 +577,8 @@
class Popen(object):
+ _shell_ = '/bin/sh'
+
def __init__(self, args, bufsize=0, executable=None,
stdin=None, stdout=None, stderr=None,
preexec_fn=None, close_fds=False, shell=False,
@@ -1121,7 +1123,7 @@
args = list(args)
if shell:
- args = ["/bin/sh", "-c"] + args
+ args = [self._shell_, "-c"] + args
if executable:
args[0] = executable
Then you can poke afni_base to set Popen._shell_ to '/bin/tcsh' without breaking other uses of python. (Although it's entirely possible, if unlikely, that afni itself can't handle that.)