[tor-commits] [bridgedb/develop] The twisted.python.util.Version class moved in Twisted>=14.0.2.

isis at torproject.org isis at torproject.org
Wed Mar 25 09:49:42 UTC 2015


commit 2a3aa5af8ce80ed4bb13fff0d23fdfd97fccdbd4
Author: Isis Lovecruft <isis at torproject.org>
Date:   Tue Mar 24 23:59:57 2015 +0000

    The twisted.python.util.Version class moved in Twisted>=14.0.2.
---
 lib/bridgedb/parse/versions.py |   11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/lib/bridgedb/parse/versions.py b/lib/bridgedb/parse/versions.py
index 8140357..ee62792 100644
--- a/lib/bridgedb/parse/versions.py
+++ b/lib/bridgedb/parse/versions.py
@@ -23,14 +23,21 @@ bridgedb.parse.versions
 ..
 """
 
-from twisted.python import util as txutil
+from twisted import version as _txversion
+
+# The twisted.python.util.Version class was moved in Twisted==14.0.0 to
+# twisted.python.versions.Version:
+if _txversion.major >= 14:
+    from twisted.python.versions import Version as _Version
+else:
+    from twisted.python.util import Version as _Version
 
 
 class InvalidVersionStringFormat(ValueError):
     """Raised when a version string is not in a parseable format."""
 
 
-class Version(txutil.Version):
+class Version(_Version):
     """Holds, parses, and does comparison operations for version numbers.
 
     :attr str package: The package name, if available.





More information about the tor-commits mailing list