Commits

jacobmason committed e3ab6b1 Merge

merge with version tracking

  • Participants
  • Parent commits 2a9ca4e, f15c4aa

Comments (0)

Files changed (3)

File doc/intro.rst

 or some (not broken) SVN trunk snapshot.  If you like to have source code
 highlighting support, you must also install the Pygments_ library.
 
+If you use **Python 2.4** you also need uuid_.
+
 .. _reStructuredText: http://docutils.sf.net/rst.html
 .. _docutils: http://docutils.sf.net/
 .. _Jinja2: http://jinja.pocoo.org/2/
 .. _Pygments: http://pygments.org/
+.. The given homepage is only a directory listing so I'm using the pypi site.
+.. _uuid: http://pypi.python.org/pypi/uuid/
 
 
 Usage
 <http://bitbucket.org/birkenfeld/sphinx/get/tip.gz#egg=Sphinx-dev>`_.
 '''
 
-requires = ['Pygments>=0.8', 'Jinja2>=2.2', 'docutils>=0.5']
+requires = ['Pygments>=0.8', 'Jinja2>=2.2', 'docutils>=0.5', 'uuid>=1.30']
 
 if sys.version_info < (2, 4):
     print('ERROR: Sphinx requires at least Python 2.4 to run.')
     except:
         pass
     else:
-        del requires[-1]
+        del requires[-2]
+elif sys.version_info >= (2, 5):
+    # An uuid module has been added to the stdlib in 2.5
+    del requires[-1]
 
 
 # Provide a "compile_catalog" command that also creates the translated

File sphinx/versioning.py

     Returns a "similiarity ratio" representing the similarity between the two
     strings where 0 is equal and anything above less than equal.
     """
-    if old == new:
-        return 0
-    ratio = levenshtein_distance(old, new) / (len(old) / 100.0)
-    return ratio
+    return levenshtein_distance(old, new) / (len(old) / 100.0)
 
 def levenshtein_distance(a, b):
+    if a == b:
+        return 0
     if len(a) < len(b):
         a, b = b, a
     if not a: