Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/cygwin-apps/calm.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Turney <jon.turney@dronecode.org.uk>2017-10-03 01:10:38 +0300
committerJon Turney <jon.turney@dronecode.org.uk>2017-10-04 01:30:27 +0300
commit1edd7bfc022bc1d1e16517ee3af0d6c3765e1e73 (patch)
tree094e315f9489f0bfcff680991ac22881b13da142
parent484dafa7e4ff07fb4fb423697a96b46532ebaaf3 (diff)
Remove unused SetupVersion._warn_ambiguous_compare
-rw-r--r--calm/version.py30
1 files changed, 0 insertions, 30 deletions
diff --git a/calm/version.py b/calm/version.py
index 027372f..6a5bbed 100644
--- a/calm/version.py
+++ b/calm/version.py
@@ -22,7 +22,6 @@
#
import itertools
-import logging
import re
@@ -63,8 +62,6 @@ class SetupVersion:
return self.__cmp__(other) == -1
def __cmp__(self, other):
- # warn about ill-specified comparisons
- # SetupVersion._warn_ambiguous_compare(self, other)
# compare V
c = SetupVersion._compare(self._V, other._V)
@@ -101,30 +98,3 @@ class SetupVersion:
# if equal length, all components have matched, so equal
# otherwise, the version with a suffix remaining is greater
return cmp(len(a), len(b))
-
- # warn if the comparison of these versions is historically under-specified
- @staticmethod
- def _warn_ambiguous_compare(a, b):
- def classify(s):
- if len(s) == 0:
- return 'e'
- elif s[0].isdigit():
- return 'n'
- elif s[0] in '.-_':
- return s[0]
- elif s[0].isalpha():
- return 'a'
- return 'o'
-
- def is_ambiguous(a, b):
- ambiguous = False
-
- for i in range(0, min(len(a), len(b))):
- if classify(a[i]) != classify(b[i]):
- ambiguous = True
- break
-
- return ambiguous
-
- if is_ambiguous(a._V, b._V) or is_ambiguous(a._R, b._R):
- logging.warning("ordering of versions '%s' and '%s' may not be what you expect" % (a._version_string, b._version_string))