File: subprocess.py

package info (click to toggle)
python-astropy-helpers 1.3-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 756 kB
  • ctags: 698
  • sloc: python: 5,929; ansic: 88; makefile: 11
file content (18 lines) | stat: -rw-r--r-- 551 bytes parent folder | download | duplicates (17)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
"""
A replacement wrapper around the subprocess module that adds
check_output (which was only added to Python in 2.7.

Instead of importing subprocess, other modules should use this as follows::

    from astropy.utils.compat import subprocess

This module is safe to import from anywhere within astropy.
"""
from __future__ import absolute_import, print_function

import subprocess
from subprocess import *

# python2.7 and later provide a check_output method
if not hasattr(subprocess, 'check_output'):
    from ._subprocess_py2 import check_output