Changeset 3435
- Timestamp:
- Jun 16, 2007, 1:59:14 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/essentials/dev-lang/python/Modules/posixmodule.c
r3364 r3435 3851 3851 char *mode = "r"; 3852 3852 int bufsize = -1; 3853 int unset_emxshell = 0; 3853 3854 FILE *fp; 3854 3855 PyObject *f; 3855 3856 if (!PyArg_ParseTuple(args, "s|si:popen", &name, &mode, &bufsize)) 3856 3857 return NULL; 3858 /* a little hack for making sure commands.getstatusoutput works 3859 * (ASSUMES that COMSPEC isn't a posix shell.) */ 3860 if (name[0] == '{' && !getenv("EMXSHELL")) { 3861 char path[512]; 3862 _searchenv("sh.exe", "PATH", path); 3863 if (!path[0]) 3864 _searchenv("ash.exe", "PATH", path); 3865 if (!path[0]) 3866 _searchenv("bash.exe", "PATH", path); 3867 if (path[0]) 3868 unset_emxshell = setenv("EMXSHELL", path, 0) == 0; 3869 } 3857 3870 Py_BEGIN_ALLOW_THREADS 3858 3871 fp = popen(name, mode); 3859 3872 Py_END_ALLOW_THREADS 3873 if (unset_emxshell) 3874 unsetenv("EMXSHELL"); 3860 3875 if (fp == NULL) 3861 3876 return posix_error(); … … 4025 4040 if ((shell = getenv("EMXSHELL")) == NULL) 4026 4041 if ((shell = getenv("COMSPEC")) == NULL) 4027 { 4028 errno = ENOENT; 4029 return posix_error(); 4030 } 4042 if ((shell = getenv("SHELL")) == NULL) 4043 if ((shell = getenv("OS2_SHELL")) == NULL) 4044 { 4045 errno = ENOENT; 4046 return posix_error(); 4047 } 4031 4048 4032 4049 sh_name = _getname(shell);
Note:
See TracChangeset
for help on using the changeset viewer.