Show More
@@ -236,18 +236,14 b' class CodeSite(object):' | |||
|
236 | 236 | def getsource(self, length): |
|
237 | 237 | if self.source is None: |
|
238 | 238 | lineno = self.lineno - 1 |
|
239 | fp = None | |
|
240 | 239 | try: |
|
241 |
|
|
|
242 | for i, line in enumerate(fp): | |
|
243 | if i == lineno: | |
|
244 | self.source = line.strip() | |
|
245 | break | |
|
240 | with open(self.path, 'rb') as fp: | |
|
241 | for i, line in enumerate(fp): | |
|
242 | if i == lineno: | |
|
243 | self.source = line.strip() | |
|
244 | break | |
|
246 | 245 | except: |
|
247 | 246 | pass |
|
248 | finally: | |
|
249 | if fp: | |
|
250 | fp.close() | |
|
251 | 247 | if self.source is None: |
|
252 | 248 | self.source = '' |
|
253 | 249 |
General Comments 0
You need to be logged in to leave comments.
Login now