Tests: Don't hardcode errno constants
The values of ENOENT and ESRCH are architecture-dependent, so don't assume they're always 2 and 3.
This commit is contained in:
committed by
Paul Beckingham
parent
59342bc10f
commit
23d63ccb44
@@ -1,5 +1,6 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import division
|
||||
import errno
|
||||
import os
|
||||
import sys
|
||||
import socket
|
||||
@@ -212,8 +213,8 @@ def _get_output(arguments, timeout=None):
|
||||
try:
|
||||
os.kill(pid, signal.SIGABRT)
|
||||
except OSError as e:
|
||||
# 3 means the process finished/died between last check and now
|
||||
if e.errno != 3:
|
||||
# ESRCH means the process finished/died between last check and now
|
||||
if e.errno != errno.ESRCH:
|
||||
raise
|
||||
|
||||
# Wait for process to finish (should die/exit after signal)
|
||||
|
||||
Reference in New Issue
Block a user