diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2014-07-30 16:48:11 -0600 |
---|---|---|
committer | Julian Taylor <jtaylor.debian@googlemail.com> | 2014-07-31 21:21:13 +0200 |
commit | dec6658cdc10a23ad0e733fb52a814306033d88c (patch) | |
tree | dfa2a5d879f9ec10f75287a045070729cf415432 /numpy/lib/_datasource.py | |
parent | 0b5a6645ee110a8d4c6b5defd8c01791ee48bda1 (diff) | |
download | numpy-dec6658cdc10a23ad0e733fb52a814306033d88c.tar.gz |
MAINT: Fixes for problems in numpy/lib revealed by pyflakes.
Some of those problems look like potential coding errors. In those
cases a Fixme comment was made and the offending code, usually an
unused variable, was commented out.
Diffstat (limited to 'numpy/lib/_datasource.py')
-rw-r--r-- | numpy/lib/_datasource.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/numpy/lib/_datasource.py b/numpy/lib/_datasource.py index 96d9af905..495bec49e 100644 --- a/numpy/lib/_datasource.py +++ b/numpy/lib/_datasource.py @@ -33,14 +33,13 @@ Example:: """ from __future__ import division, absolute_import, print_function -__docformat__ = "restructuredtext en" - import os import sys -from shutil import rmtree, copyfile, copyfileobj +import shutil _open = open + # Using a class instead of a module-level dictionary # to reduce the inital 'import numpy' overhead by # deferring the import of bz2 and gzip until needed @@ -209,7 +208,7 @@ class DataSource (object): def __del__(self): # Remove temp directories if self._istmpdest: - rmtree(self._destpath) + shutil.rmtree(self._destpath) def _iszip(self, filename): """Test if the filename is a zip file by looking at the file extension. @@ -294,7 +293,7 @@ class DataSource (object): openedurl = urlopen(path) f = _open(upath, 'wb') try: - copyfileobj(openedurl, f) + shutil.copyfileobj(openedurl, f) finally: f.close() openedurl.close() |