about summary refs log tree commit diff stats
path: root/ranger/ext/waitpid_no_intr.py
diff options
context:
space:
mode:
Diffstat (limited to 'ranger/ext/waitpid_no_intr.py')
-rw-r--r--ranger/ext/waitpid_no_intr.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/ranger/ext/waitpid_no_intr.py b/ranger/ext/waitpid_no_intr.py
index c14fa5b9..12fbcbce 100644
--- a/ranger/ext/waitpid_no_intr.py
+++ b/ranger/ext/waitpid_no_intr.py
@@ -13,17 +13,18 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+from errno import EINTR
+from os import waitpid
+
 def waitpid_no_intr(pid):
 	"""catch interrupts which occur while using os.waitpid"""
-	import os, errno
-
 	while True:
 		try:
-			return os.waitpid(pid, 0)
+			return waitpid(pid, 0)
 		except KeyboardInterrupt:
 			continue
 		except OSError as e:
-			if e.errno == errno.EINTR:
+			if e.errno == EINTR:
 				continue
 			else:
 				raise