diff --git a/Lib/platform.py b/Lib/platform.py index 8051041..109e9b6 100755 --- a/Lib/platform.py +++ b/Lib/platform.py @@ -986,21 +986,19 @@ def _syscmd_uname(option,default=''): return output def _syscmd_file(target,default=''): + """ + Interface to the system's file command. - """ Interface to the system's file command. - - The function uses the -b option of the file command to have it - ommit the filename in its output and if possible the -L option - to have the command follow symlinks. It returns default in - case the command should fail. - + The function uses the -b option of the file command to have it ommit + the filename in its output. Follow the symlinks. It returns default in + case the command should fail. """ if sys.platform in ('dos','win32','win16','os2'): # XXX Others too ? return default target = _follow_symlinks(target).replace('"', '\\"') try: - f = os.popen('file "%s" 2> %s' % (target, DEV_NULL)) + f = os.popen('file -b "%s" 2> %s' % (target, DEV_NULL)) except (AttributeError,os.error): return default output = f.read().strip()