From 6801d5f572223d8ee07c668de67d4c6df320ffd8 Mon Sep 17 00:00:00 2001
From: Zooko O'Whielacronx <zooko@zooko.com>
Date: Thu, 28 Aug 2008 15:04:54 -0700
Subject: [PATCH] setup: emit the version of python in the list of versions

---
 src/allmydata/__init__.py | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/src/allmydata/__init__.py b/src/allmydata/__init__.py
index f79b93ff..4c8c5712 100644
--- a/src/allmydata/__init__.py
+++ b/src/allmydata/__init__.py
@@ -23,7 +23,14 @@ import _auto_deps
 _auto_deps.require_auto_deps()
 
 def get_package_versions():
-    import OpenSSL, allmydata, foolscap, nevow, pycryptopp, simplejson, twisted, zfec
+    import OpenSSL, allmydata, foolscap, nevow, pycryptopp, simplejson, twisted, zfec, sys
+
+    from distutils.version import LooseVersion
+    try:
+        pyver = LooseVersion('.'.join([str(c) for c in sys.version_info]))
+    except:
+        pyver = sys.version
+
     setuptools_version = "unavailable"
     try:
         import setuptools
@@ -40,12 +47,13 @@ def get_package_versions():
         'simplejson': simplejson.__version__,
         'twisted': twisted.__version__,
         'zfec': zfec.__version__,
+        'python': pyver,
         }
 
 def get_package_versions_string():
     versions = get_package_versions()
     res = []
-    for p in ["allmydata", "foolscap", "pycryptopp", "zfec", "twisted", "nevow"]:
+    for p in ["allmydata", "foolscap", "pycryptopp", "zfec", "twisted", "nevow", "python"]:
         if versions.has_key(p):
             res.append(str(p) + ": " + str(versions[p]))
             del versions[p]
-- 
2.45.2