[pypy-commit] pypy default: simplify
pjenvey
noreply at buildbot.pypy.org
Fri May 3 02:04:43 CEST 2013
Author: Philip Jenvey <pjenvey at underboss.org>
Branch:
Changeset: r63812:15827dd3d414
Date: 2013-05-02 17:03 -0700
http://bitbucket.org/pypy/pypy/changeset/15827dd3d414/
Log: simplify
diff --git a/pypy/module/imp/importing.py b/pypy/module/imp/importing.py
--- a/pypy/module/imp/importing.py
+++ b/pypy/module/imp/importing.py
@@ -16,6 +16,8 @@
from rpython.rlib.objectmodel import we_are_translated, specialize
from pypy.module.sys.version import PYPY_VERSION
+_WIN32 = sys.platform == 'win32'
+
SEARCH_ERROR = 0
PY_SOURCE = 1
PY_COMPILED = 2
@@ -27,12 +29,8 @@
# PY_CODERESOURCE = 8
IMP_HOOK = 9
-if sys.platform == 'win32':
- SO = ".pyd"
-else:
- SO = ".so"
+SO = '.pyd' if _WIN32 else '.so'
DEFAULT_SOABI = 'pypy-%d%d' % PYPY_VERSION[:2]
-CHECK_FOR_PYW = sys.platform == 'win32'
@specialize.memo()
def get_so_extension(space):
@@ -64,7 +62,7 @@
return PY_SOURCE, ".py", "U"
# on Windows, also check for a .pyw file
- if CHECK_FOR_PYW:
+ if _WIN32:
pyfile = filepart + ".pyw"
if file_exists(pyfile):
return PY_SOURCE, ".pyw", "U"
More information about the pypy-commit
mailing list