[pypy-svn] r17839 - in pypy/dist/pypy/module/sys: . test
arigo at codespeak.net
arigo at codespeak.net
Sat Sep 24 20:21:18 CEST 2005
Author: arigo
Date: Sat Sep 24 20:21:14 2005
New Revision: 17839
Modified:
pypy/dist/pypy/module/sys/__init__.py
pypy/dist/pypy/module/sys/test/test_sysmodule.py
pypy/dist/pypy/module/sys/version.py
Log:
Playing around with version numbers in the sys.pypy_* attributes.
The pypy_svn_url attribute now also contains the revision number, to make
it clear that it's a revision number and that both informations are useful
mostly only if they are together.
Modified: pypy/dist/pypy/module/sys/__init__.py
==============================================================================
--- pypy/dist/pypy/module/sys/__init__.py (original)
+++ pypy/dist/pypy/module/sys/__init__.py Sat Sep 24 20:21:14 2005
@@ -52,7 +52,7 @@
'version_info' : 'version.get_version_info(space)',
'version' : 'version.get_version(space)',
'pypy_version_info' : 'version.get_pypy_version_info(space)',
- 'pypy_svn_url' : 'space.wrap("$HeadURL$"[10:-29])',
+ 'pypy_svn_url' : 'version.get_svn_url(space)',
'hexversion' : 'version.get_hexversion(space)',
'ps1' : 'space.wrap(">>>> ")',
'ps2' : 'space.wrap(".... ")',
Modified: pypy/dist/pypy/module/sys/test/test_sysmodule.py
==============================================================================
--- pypy/dist/pypy/module/sys/test/test_sysmodule.py (original)
+++ pypy/dist/pypy/module/sys/test/test_sysmodule.py Sat Sep 24 20:21:14 2005
@@ -358,7 +358,7 @@
assert isinstance(vi[1], int)
assert isinstance(vi[2], int)
assert vi[3] in ("alpha", "beta", "candidate", "final")
- assert isinstance(vi[4], int) or vi[4] == '?'
+ assert isinstance(vi[4], int)
def test_allattributes(self):
sys.__dict__ # check that we don't crash initializing any attribute
Modified: pypy/dist/pypy/module/sys/version.py
==============================================================================
--- pypy/dist/pypy/module/sys/version.py (original)
+++ pypy/dist/pypy/module/sys/version.py Sat Sep 24 20:21:14 2005
@@ -11,6 +11,8 @@
PYPY_VERSION = (0, 7, 1, "alpha", '?')
# the last item is replaced by the svn revision ^^^
+SVN_URL = "$HeadURL: http://codespeak.net/svn/pypy/dist/pypy/module/sys/version.py $"[10:-28]
+
# ____________________________________________________________
@@ -37,6 +39,9 @@
ver = ver[:-1] + (svn_revision(),)
return space.wrap(ver)
+def get_svn_url(space):
+ return space.wrap((SVN_URL, svn_revision()))
+
def tuple2hex(ver):
d = {'alpha': 0xA,
'beta': 0xB,
@@ -56,7 +61,7 @@
"Return the last-changed svn revision number."
# NB. we hack the number directly out of the .svn directory to avoid
# to depend on an external 'svn' executable in the path.
- rev = '?'
+ rev = 0
try:
f = open(os.path.join(autopath.pypydir, '.svn', 'entries'), 'r')
for line in f:
More information about the Pypy-commit
mailing list