Skip to content

Commit

Permalink
Debug lines
Browse files Browse the repository at this point in the history
  • Loading branch information
facundobatista committed Jul 17, 2017
1 parent 6819d7c commit e20bcfa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions fades/pipmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,14 @@ def get_version(self, dependency):
def _download_pip_installer(self):
u = request.urlopen(PIP_INSTALLER)
temp_location = self.pip_installer_fname + '.temp'
print("===== download 1, temp location exists", os.path.exists(temp_location))
with contextlib.closing(u), open(temp_location, 'wb') as f:
shutil.copyfileobj(u, f)
print("===== download 2, temp location exists", os.path.exists(temp_location))
print("===== download 2, final installer exists", os.path.exists(self.pip_installer_fname))
os.rename(temp_location, self.pip_installer_fname)
print("===== download 3, temp location exists", os.path.exists(temp_location))
print("===== download 3, final installer exists", os.path.exists(self.pip_installer_fname))

def _brute_force_install_pip(self):
"""A brute force install of pip itself."""
Expand Down
2 changes: 2 additions & 0 deletions tests/test_pipmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,9 @@ def test_download_pip_installer(self):

# get a tempfile and remove it, so later the installer is downloaded there
tempfile = get_tempfile(self)
print("========== test, tempfile created, exists?", os.path.exists(tempfile))
os.remove(tempfile)
print("========== test, tempfile removed, exists?", os.path.exists(tempfile))

mgr.pip_installer_fname = tempfile
with patch('fades.pipmanager.request.urlopen') as urlopen:
Expand Down

0 comments on commit e20bcfa

Please sign in to comment.