Skip to content

Commit 4e2d3d4

Browse files
remove python 2.7 support and make 3.8 the minimum supported version
1 parent 5658f40 commit 4e2d3d4

5 files changed

Lines changed: 12 additions & 18 deletions

File tree

Evtx/BinaryParser.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@
2323
from datetime import datetime
2424
from functools import partial
2525

26-
import six
27-
2826

2927
class memoize(object):
3028
"""cache the return value of a method
@@ -556,7 +554,7 @@ def unpack_guid(self, offset):
556554
raise OverrunBufferException(o, len(self._buf))
557555

558556
# Yeah, this is ugly
559-
h = [six.indexbytes(_bin, i) for i in range(len(_bin))]
557+
h = [_bin[i] for i in range(len(_bin))]
560558
return """{:02x}{:02x}{:02x}{:02x}-{:02x}{:02x}-{:02x}{:02x}-{:02x}{:02x}-{:02x}{:02x}{:02x}{:02x}{:02x}{:02x}""".format(
561559
h[3], h[2], h[1], h[0],
562560
h[5], h[4],

Evtx/Nodes.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import base64
2222
import itertools
2323

24-
import six
2524
import hexdump
2625

2726
from .BinaryParser import Block
@@ -1470,7 +1469,7 @@ def string(self):
14701469
ret = "0x"
14711470
b = self.hex()[::-1]
14721471
for i in range(len(b)):
1473-
ret += '{:02x}'.format(six.indexbytes(b, i))
1472+
ret += '{:02x}'.format(b[i])
14741473
return ret
14751474

14761475

@@ -1490,7 +1489,7 @@ def string(self):
14901489
ret = "0x"
14911490
b = self.hex()[::-1]
14921491
for i in range(len(b)):
1493-
ret += '{:02x}'.format(six.indexbytes(b, i))
1492+
ret += '{:02x}'.format(b[i])
14941493
return ret
14951494

14961495

Evtx/Views.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020
import re
2121
import xml.sax.saxutils
2222

23-
import six
24-
2523
import Evtx.Nodes as e_nodes
2624

2725

@@ -180,7 +178,7 @@ def rec(node, acc):
180178
def render_root_node(root_node):
181179
subs = []
182180
for sub in root_node.substitutions():
183-
if isinstance(sub, six.string_types):
181+
if isinstance(sub, str):
184182
raise RuntimeError('string sub?')
185183

186184
if sub is None:

scripts/evtx_dump_json.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,17 @@
44
#
55
# Purpose: User can dump evtx data into JSON format to either the command line or a JSON file in new line delimited format/JSON array.
66
# Details: The JSON object is created with only the EventRecordID from the System section of the evtx XML and all of the information within the EventData section.
7+
#
8+
# Requires:
9+
# - xmltodict >= 0.12.0
10+
import os
11+
import json
12+
13+
import xmltodict
714

815
import Evtx.Evtx as evtx
916
import Evtx.Views as e_views
1017

11-
# Added packages
12-
import os
13-
import xmltodict
14-
import json
15-
1618

1719
def main():
1820
import argparse

setup.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,15 @@
2121
url="https://github.com/williballenthin/python-evtx",
2222
license="Apache 2.0 License",
2323
packages=setuptools.find_packages(),
24+
python_requires='>=3.8',
2425
install_requires=[
25-
'six',
2626
'hexdump>=3.3',
27-
'xmltodict>=0.12.0', #added deps for evtx_dump_json.py script
2827

29-
# pin deps for python 2, see #67
3028
'more_itertools>=5.0.0',
3129
'zipp>=1.0.0',
3230
'pyparsing>=2.4.7',
3331
],
3432
extras_require={
35-
# For running unit tests & coverage
3633
"test": [
3734
'pytest-cov>=2.11.1',
3835
'pytest>=4.6.11',

0 commit comments

Comments
 (0)