Skip to content

Commit 2920b77

Browse files
committed
Refactor astroquery/utils/system_tools.py
All imports are now done at modul level and unused code has been removed.
1 parent bf09762 commit 2920b77

File tree

1 file changed

+3
-14
lines changed

1 file changed

+3
-14
lines changed

astroquery/utils/system_tools.py

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,8 @@
11
# Licensed under a 3-clause BSD style license - see LICENSE.rst
22

3+
import gzip
34
import os
4-
5-
# Import DEVNULL for py3 or py3
6-
try:
7-
from subprocess import DEVNULL
8-
except ImportError:
9-
DEVNULL = open(os.devnull, 'wb')
10-
11-
# Check availability of some system tools
12-
# Exceptions are raised if not found
5+
import shutil
136

147

158
def gunzip(filename):
@@ -19,17 +12,13 @@ def gunzip(filename):
1912
----------
2013
filename : str
2114
Fully qualified path of the file to decompress.
15+
2216
Returns
2317
-------
2418
filename : str
2519
Name of the decompressed file (or input filename if gzip is not
2620
available).
2721
"""
28-
import shutil
29-
import gzip
30-
31-
# system-wide 'gzip' was removed, Python gzip used instead.
32-
# See #1538 : https://github.com/astropy/astroquery/issues/1538
3322

3423
# ".fz" denotes RICE rather than gzip compression
3524
if not filename.endswith('.fz'):

0 commit comments

Comments
 (0)