File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -149,13 +149,19 @@ def from_version(cls, version: "Version") -> "PEP440Version":
149149 return cls .from_string (str (version ))
150150
151151 def __eq__ (self , other : Any ) -> bool :
152+ if isinstance (other , str ):
153+ # allow to compare against "current" for now
154+ return False
152155 if not isinstance (other , Version ):
153156 raise ValueError (f"Can't compare { type (self )} with { type (other )} " )
154157 if not isinstance (other , type (self )):
155158 other = self .from_version (other )
156159 return self ._version == other ._version
157160
158161 def __ne__ (self , other : Any ) -> bool :
162+ if isinstance (other , str ):
163+ # allow to compare against "current" for now
164+ return True
159165 if not isinstance (other , Version ):
160166 raise ValueError (f"Can't compare { type (self )} with { type (other )} " )
161167 if not isinstance (other , type (self )):
Original file line number Diff line number Diff line change @@ -116,6 +116,9 @@ def patch(self) -> int:
116116 return self ._version_info .patch
117117
118118 def __eq__ (self , other : Any ) -> bool :
119+ if isinstance (other , str ):
120+ # allow to compare against "current" for now
121+ return False
119122 if not isinstance (other , Version ):
120123 raise ValueError (f"Can't compare { type (self )} with { type (other )} " )
121124 if not isinstance (other , type (self )):
@@ -124,6 +127,9 @@ def __eq__(self, other: Any) -> bool:
124127 return self ._version_info == other ._version_info
125128
126129 def __ne__ (self , other : Any ) -> bool :
130+ if isinstance (other , str ):
131+ # allow to compare against "current" for now
132+ return True
127133 if not isinstance (other , Version ):
128134 raise ValueError (f"Can't compare { type (self )} with { type (other )} " )
129135 if not isinstance (other , type (self )):
You can’t perform that action at this time.
0 commit comments