Skip to content

Commit

Permalink
Merge pull request #112 from nephila/feature/error_pip
Browse files Browse the repository at this point in the history
In case of pip errors while installing, immediately raise exception to p...
  • Loading branch information
yakky committed May 20, 2014
2 parents e10d575 + 3564dc4 commit 825b470
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions djangocms_installer/install/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# -*- coding: utf-8 -*-
import tempfile
import os.path

import pip
from pip.exceptions import InstallationError
from pip.status_codes import SUCCESS


def check_install(config_data):
Expand Down Expand Up @@ -60,4 +61,7 @@ def requirements(requirements, is_file=False):
else:
args = ['install', '-q', ]
args.extend(requirements.split())
command = pip.main(args)
exit_status = pip.main(args)
if exit_status != SUCCESS:
raise InstallationError("Error while installing requirements. Check pip log file for error details.")
return True

0 comments on commit 825b470

Please sign in to comment.