Skip to content

Commit 9e51253

Browse files
fix linting issues
1 parent e61c872 commit 9e51253

File tree

10 files changed

+6
-23
lines changed

10 files changed

+6
-23
lines changed

Evtx/BinaryParser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def dosdate(dosdate, dostime):
9898
hour = (t & 0b1111100000000000) >> 11
9999

100100
return datetime.datetime(year, month, day, hour, minute, sec)
101-
except:
101+
except ValueError:
102102
return datetime.datetime.min
103103

104104

scripts/evtx_dump_chunk_slack.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,8 @@ def main():
3636
last_allocated_offset = chunk_start
3737
for record in chunk.records():
3838
last_allocated_offset = record.offset() + record.size()
39-
try:
40-
sys.stdout.buffer.write(buf[last_allocated_offset : chunk_start + 0x10000])
41-
except:
42-
sys.stdout.write(buf[last_allocated_offset : chunk_start + 0x10000])
39+
40+
sys.stdout.buffer.write(buf[last_allocated_offset : chunk_start + 0x10000])
4341

4442

4543
if __name__ == "__main__":

scripts/evtx_dump_json.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
import xmltodict
1414

1515
import Evtx.Evtx as evtx
16-
import Evtx.Views as e_views
1716

1817

1918
def main():

tests/test_chunks.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from fixtures import *
2-
31
import Evtx.Evtx as evtx
42

53
EMPTY_MAGIC = "\x00" * 0x8

tests/test_header.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from fixtures import *
2-
31
import Evtx.Evtx as evtx
42

53

tests/test_issue_37.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import os
22

33
import pytest
4-
from fixtures import *
54

65
import Evtx.Evtx as evtx
76

tests/test_issue_38.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
import os
22

3-
import pytest
4-
from fixtures import *
5-
63
import Evtx.Evtx as evtx
74

85

tests/test_issue_39.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
import os
22

3-
import pytest
4-
from fixtures import *
5-
63
import Evtx.Evtx as evtx
74

85

tests/test_issue_43.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import os
22

33
import pytest
4-
from fixtures import *
54

65
import Evtx.Evtx as evtx
76

tests/test_records.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
import textwrap
2+
import importlib.util
23

34
import pytest
4-
from fixtures import *
55

66
import Evtx.Evtx as evtx
77
import Evtx.Nodes as e_nodes
88

9-
try:
10-
import lxml
11-
9+
if importlib.util.find_spec("lxml"):
1210
no_lxml = False
13-
except:
11+
else:
1412
no_lxml = True
1513

1614

0 commit comments

Comments
 (0)