Skip to content

Commit

Permalink
test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
qwcode committed Aug 4, 2012
1 parent 2927078 commit e287e00
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
11 changes: 10 additions & 1 deletion pip/req.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
DistributionNotFound)
from pip.vcs import vcs
from pip.log import logger
from pip.util import display_path, rmtree
from pip.util import display_path, rmtree, is_pypy
from pip.util import ask, ask_path_exists, backup_dir
from pip.util import is_installable_dir, is_local, dist_is_local, dist_in_usersite
from pip.util import renames, normalize_path, egg_link_path, dist_in_site_packages
Expand Down Expand Up @@ -1437,6 +1437,15 @@ def add(self, path):
else:
self._refuse.add(path)

#workaround for pip issue #626 (debian pypy creates __pycache__ folders)
if is_pypy:
head, tail = os.path.split(path)
tail_root, tail_ext = os.path.splitext(tail)
if tail_ext == '.py':
pycache_path = os.path.join(head, '__pycache__', tail_root + '.pypy-%d%d.pyc' % sys.pypy_version_info[:2])
self.add(pycache_path)


def add_pth(self, pth_file, entry):
pth_file = normalize_path(pth_file)
if self._permitted(pth_file):
Expand Down
1 change: 1 addition & 0 deletions pip/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ def is_svn_page(html):
return (re.search(r'<title>[^<]*Revision \d+:', html)
and re.search(r'Powered by (?:<a[^>]*?>)?Subversion', html, re.I))

is_pypy = hasattr(sys, 'pypy_version_info')

def file_contents(filename):
fp = open(filename, 'rb')
Expand Down

0 comments on commit e287e00

Please sign in to comment.