Skip to content

Commit 77c578a

Browse files
committed
kill LazyVersion
1 parent 88181da commit 77c578a

1 file changed

Lines changed: 0 additions & 40 deletions

File tree

Lib/_pyrepl/fancycompleter.py

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -36,46 +36,6 @@
3636

3737
# ----------------------
3838

39-
40-
class LazyVersion(object):
41-
42-
def __init__(self, pkg):
43-
self.pkg = pkg
44-
self.__version = None
45-
46-
@property
47-
def version(self):
48-
if self.__version is None:
49-
self.__version = self._load_version()
50-
return self.__version
51-
52-
def _load_version(self):
53-
try:
54-
from pkg_resources import get_distribution, DistributionNotFound
55-
except ImportError:
56-
return 'N/A'
57-
#
58-
try:
59-
return get_distribution(self.pkg).version
60-
except DistributionNotFound:
61-
# package is not installed
62-
return 'N/A'
63-
64-
def __repr__(self):
65-
return self.version
66-
67-
def __eq__(self, other):
68-
return self.version == other
69-
70-
def __ne__(self, other):
71-
return not self == other
72-
73-
74-
__version__ = LazyVersion(__name__)
75-
76-
# ----------------------
77-
78-
7939
class Color:
8040
black = '30'
8141
darkred = '31'

0 commit comments

Comments
 (0)