From e483afd056edf4b8963ca095ea44155e5d61be57 Mon Sep 17 00:00:00 2001 From: hut Date: Sun, 24 Feb 2013 23:36:21 +0100 Subject: removed unused lib ranger.ext.run_forked --- ranger/ext/run_forked.py | 25 ------------------------- 1 file changed, 25 deletions(-) delete mode 100644 ranger/ext/run_forked.py diff --git a/ranger/ext/run_forked.py b/ranger/ext/run_forked.py deleted file mode 100644 index f8dd2642..00000000 --- a/ranger/ext/run_forked.py +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright (C) 2012-2013 Roman Zimbelmann -# This software is distributed under the terms of the GNU GPL version 3. - -import os -import subprocess - -def Popen_forked(*args, **kwargs): - """Forks process and runs Popen with the given args and kwargs. - - If os.fork() is not supported, runs Popen without forking and returns the - process object returned by Popen. - Otherwise, returns None. - """ - try: - pid = os.fork() - except: - # fall back to not forking if os.fork() is not supported - return subprocess.Popen(*args, **kwargs) - else: - if pid == 0: - os.setsid() - kwargs['stdin'] = open(os.devnull, 'r') - kwargs['stdout'] = kwargs['stderr'] = open(os.devnull, 'w') - subprocess.Popen(*args, **kwargs) - os._exit(0) -- cgit 1.4.1-2-gfad0