Issue #10280: NNTP.nntp_version should reflect the highest version

advertised by the server.
This commit is contained in:
Antoine Pitrou 2010-11-02 22:31:52 +00:00
parent e159422ce9
commit f80b3f72c6
3 changed files with 9 additions and 4 deletions

View file

@ -361,7 +361,9 @@ class _NNTPBase:
else:
self._caps = caps
if 'VERSION' in caps:
self.nntp_version = int(caps['VERSION'][0])
# The server can advertise several supported versions,
# choose the highest.
self.nntp_version = max(map(int, caps['VERSION']))
def getwelcome(self):
"""Get the welcome message from the server