Mercurial > hg
comparison mercurial/__init__.py @ 29490:b4d117cee636
policy: add cffi policy for PyPy
This adds cffi policy in the case where we don't want to use C modules,
but instead we're happy to rely on cffi (bundled with pypy)
author | Maciej Fijalkowski <fijall@gmail.com> |
---|---|
date | Tue, 07 Jun 2016 15:35:58 +0200 |
parents | b3a677c82a35 |
children | 1c22400db72d |
comparison
equal
deleted
inserted
replaced
29489:54ad81b0665f | 29490:b4d117cee636 |
---|---|
57 if not zl: | 57 if not zl: |
58 zl = zipimport.zipimporter(path) | 58 zl = zipimport.zipimporter(path) |
59 return zl | 59 return zl |
60 | 60 |
61 try: | 61 try: |
62 if modulepolicy == 'py': | 62 if modulepolicy in policy.policynoc: |
63 raise ImportError() | 63 raise ImportError() |
64 | 64 |
65 zl = ziploader('mercurial') | 65 zl = ziploader('mercurial') |
66 mod = zl.load_module(name) | 66 mod = zl.load_module(name) |
67 # Unlike imp, ziploader doesn't expose module metadata that | 67 # Unlike imp, ziploader doesn't expose module metadata that |
84 # Instead you have to pass the parent package's __path__ attribute | 84 # Instead you have to pass the parent package's __path__ attribute |
85 # as the path argument. | 85 # as the path argument. |
86 stem = name.split('.')[-1] | 86 stem = name.split('.')[-1] |
87 | 87 |
88 try: | 88 try: |
89 if modulepolicy == 'py': | 89 if modulepolicy in policy.policynoc: |
90 raise ImportError() | 90 raise ImportError() |
91 | 91 |
92 modinfo = imp.find_module(stem, mercurial.__path__) | 92 modinfo = imp.find_module(stem, mercurial.__path__) |
93 | 93 |
94 # The Mercurial installer used to copy files from | 94 # The Mercurial installer used to copy files from |