Commit 75458c28e627bee7ddc81bfe869bc082da6a6e83
1 parent
2b4c84f2
print compliant python3.5
Showing
1 changed file
with
3 additions
and
3 deletions
oletools/olevba.py
| @@ -214,7 +214,7 @@ __version__ = '0.48' | @@ -214,7 +214,7 @@ __version__ = '0.48' | ||
| 214 | 214 | ||
| 215 | import sys, logging | 215 | import sys, logging |
| 216 | import struct | 216 | import struct |
| 217 | -import cStringIO | 217 | +from _io import StringIO |
| 218 | import math | 218 | import math |
| 219 | import zipfile | 219 | import zipfile |
| 220 | import re | 220 | import re |
| @@ -1205,7 +1205,7 @@ def _extract_vba(ole, vba_root, project_path, dir_path, relaxed=False): | @@ -1205,7 +1205,7 @@ def _extract_vba(ole, vba_root, project_path, dir_path, relaxed=False): | ||
| 1205 | else: | 1205 | else: |
| 1206 | raise UnexpectedDataError(dir_path, name, expected, value) | 1206 | raise UnexpectedDataError(dir_path, name, expected, value) |
| 1207 | 1207 | ||
| 1208 | - dir_stream = cStringIO.StringIO(decompress_stream(dir_compressed)) | 1208 | + dir_stream = StringIO(decompress_stream(dir_compressed)) |
| 1209 | 1209 | ||
| 1210 | # PROJECTSYSKIND Record | 1210 | # PROJECTSYSKIND Record |
| 1211 | projectsyskind_id = struct.unpack("<H", dir_stream.read(2))[0] | 1211 | projectsyskind_id = struct.unpack("<H", dir_stream.read(2))[0] |
| @@ -2131,7 +2131,7 @@ class VBA_Parser(object): | @@ -2131,7 +2131,7 @@ class VBA_Parser(object): | ||
| 2131 | _file = filename | 2131 | _file = filename |
| 2132 | else: | 2132 | else: |
| 2133 | # file already read in memory, make it a file-like object for zipfile: | 2133 | # file already read in memory, make it a file-like object for zipfile: |
| 2134 | - _file = cStringIO.StringIO(data) | 2134 | + _file = StringIO(data) |
| 2135 | #self.file = _file | 2135 | #self.file = _file |
| 2136 | self.ole_file = None | 2136 | self.ole_file = None |
| 2137 | self.ole_subfiles = [] | 2137 | self.ole_subfiles = [] |