mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-10-17 01:17:21 +02:00
Made sure the fd gets closed in Http.kernel.
This commit is contained in:
parent
aaef8cdf70
commit
1aaf611158
@ -312,6 +312,7 @@ class Http(callbacks.Privmsg):
|
|||||||
|
|
||||||
Returns information about the current version of the Linux kernel.
|
Returns information about the current version of the Linux kernel.
|
||||||
"""
|
"""
|
||||||
|
try:
|
||||||
fd = webutils.getUrlFd('http://www.kernel.org/kdist/finger_banner')
|
fd = webutils.getUrlFd('http://www.kernel.org/kdist/finger_banner')
|
||||||
for line in fd:
|
for line in fd:
|
||||||
(name, version) = line.split(':')
|
(name, version) = line.split(':')
|
||||||
@ -319,6 +320,7 @@ class Http(callbacks.Privmsg):
|
|||||||
stable = version.strip()
|
stable = version.strip()
|
||||||
elif 'latest beta' in name:
|
elif 'latest beta' in name:
|
||||||
beta = version.strip()
|
beta = version.strip()
|
||||||
|
finally:
|
||||||
fd.close()
|
fd.close()
|
||||||
irc.reply(msg, 'The latest stable kernel is %s; ' \
|
irc.reply(msg, 'The latest stable kernel is %s; ' \
|
||||||
'the latest beta kernel is %s.' % (stable, beta))
|
'the latest beta kernel is %s.' % (stable, beta))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user