##// END OF EJS Templates
extensions: use context manger for open()
Yuya Nishihara -
r38363:c6f82a18 default
parent child Browse files
Show More
@@ -605,12 +605,10 b' def _moduledoc(file):'
605 605 def _disabledhelp(path):
606 606 '''retrieve help synopsis of a disabled extension (without importing)'''
607 607 try:
608 file = open(path, 'rb')
608 with open(path, 'rb') as src:
609 doc = _moduledoc(src)
609 610 except IOError:
610 611 return
611 else:
612 doc = _moduledoc(file)
613 file.close()
614 612
615 613 if doc: # extracting localized synopsis
616 614 return gettext(doc)
General Comments 0
You need to be logged in to leave comments. Login now