~ubuntu-branches/ubuntu/wily/python-pip/wily

« back to all changes in this revision

Viewing changes to pip/__init__.py

  • Committer: Package Import Robot
  • Author(s): Barry Warsaw
  • Date: 2014-06-06 12:26:53 UTC
  • Revision ID: package-import@ubuntu.com-20140606122653-npmit7p0jdyk54be
Tags: 1.5.6-2
* Team upload.
* d/patches/use-venv-wheels.patch: Use OSError and check errno
  instead of using FileNotFoundError, since the latter doesn't
  exist in Python 2.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
 
5
5
import sys
6
6
import re
 
7
import errno
7
8
 
8
9
# Debian virtual environment (venv) support.  When inside a venv, we have to
9
10
# add all the devendorized wheels to sys.path from inside the venv, otherwise
48
49
        for filename in os.listdir(wheel_dir):
49
50
            if os.path.splitext(filename)[1] == '.whl':
50
51
                sys.path.insert(0, os.path.join(wheel_dir, filename))
51
 
    except FileNotFoundError:
52
 
        # Oh well.
53
 
        pass
 
52
    # FileNotFoundError doesn't exist in Python 2, but ignore it anyway.
 
53
    except OSError as error:
 
54
        if error.errno != errno.ENOENT:
 
55
            raise
 
56
 
54
57
 
55
58
from pip.exceptions import InstallationError, CommandError, PipError
56
59
from pip.log import logger