import and use subprocess.py from python 2.6.

This should hopefully let us run even on python 2.3 on really old servers.
This commit is contained in:
Avery Pennarun
2010-10-01 12:06:56 -07:00
parent 7d3028dee2
commit da774f3f46
7 changed files with 1319 additions and 18 deletions

View File

@ -1,6 +1,7 @@
import re, struct, socket, select, subprocess, traceback
import re, struct, socket, select, traceback
if not globals().get('skip_imports'):
import ssnet, helpers, hostwatch
import compat.ssubprocess as ssubprocess
from ssnet import SockWrapper, Handler, Proxy, Mux, MuxWrapper
from helpers import *
@ -43,7 +44,7 @@ def _maskbits(netmask):
def _list_routes():
argv = ['netstat', '-rn']
p = subprocess.Popen(argv, stdout=subprocess.PIPE)
p = ssubprocess.Popen(argv, stdout=ssubprocess.PIPE)
routes = []
for line in p.stdout:
cols = re.split(r'\s+', line)