Show More
@@ -2176,12 +2176,13 b' Currently the magic system has the following functions:\\n"""' | |||
|
2176 | 2176 | # logic, going with utf-8 is a simple solution likely to be right |
|
2177 | 2177 | # in most real-world cases. |
|
2178 | 2178 | linesource = fileobj.read().decode('utf-8', 'replace').splitlines() |
|
2179 | fileobj.close() | |
|
2179 | 2180 | else: |
|
2180 | fileobj = linesource = open(arg_s) | |
|
2181 | with open(arg_s) as fileobj: | |
|
2182 | linesource = fileobj.read().splitlines() | |
|
2181 | 2183 | |
|
2182 | 2184 | # Strip out encoding declarations |
|
2183 | 2185 | lines = [l for l in linesource if not _encoding_declaration_re.match(l)] |
|
2184 | fileobj.close() | |
|
2185 | 2186 | |
|
2186 | 2187 | self.set_next_input(os.linesep.join(lines)) |
|
2187 | 2188 |
General Comments 0
You need to be logged in to leave comments.
Login now