File tree Expand file tree Collapse file tree 1 file changed +11
-10
lines changed Expand file tree Collapse file tree 1 file changed +11
-10
lines changed Original file line number Diff line number Diff line change 4
4
'''
5
5
import os
6
6
import sys
7
+ import subprocess
7
8
8
- def run (cmd ):
9
- print (cmd )
10
- r = os .system (cmd )
11
- if r != 0 :
12
- sys .exit ('command %s failed with status %s' % (cmd , r ))
9
+
10
+ def install (packages ):
11
+ print ('Installing %s...' % ', ' .join (packages ))
12
+ subprocess .check_call (['sudo' , 'apt-get' , 'install' , '-qq' ] + packages )
13
13
14
14
py3k = sys .version_info [0 ] == 3
15
15
if os .environ ['PYTEST_QT_API' ] in ('pyqt4' , 'pyqt5' ):
16
16
pyqt_ver = os .environ ['PYTEST_QT_API' ][- 1 ]
17
17
if py3k :
18
- run ( 'sudo apt-get install -qq python3-pyqt%s' % pyqt_ver )
18
+ pkg = ' python3-pyqt%s' % pyqt_ver
19
19
else :
20
- run ('sudo apt-get install -qq python-qt%s' % pyqt_ver )
20
+ pkg = 'python-qt%s' % pyqt_ver
21
+ install ([pkg , pkg + '-dbg' ])
21
22
else :
22
23
if py3k :
23
- run ( 'sudo apt-get install -qq python3-pyside')
24
+ pkg = ' python3-pyside'
24
25
else :
25
- run ( 'sudo apt-get install -qq python-pyside')
26
-
26
+ pkg = ' python-pyside'
27
+ install ([ pkg ])
You can’t perform that action at this time.
0 commit comments