Skip to content

Commit e7eb04c

Browse files
author
Jarry XIAO
committed
bugfix for #58
1 parent a7c5fd7 commit e7eb04c

File tree

7 files changed

+12
-9
lines changed

7 files changed

+12
-9
lines changed

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{
2-
"python.pythonPath": ".venv/bin/python",
32
"cSpell.words": [
43
"Acked",
54
"Chksum",
@@ -16,6 +15,7 @@
1615
"ISDN",
1716
"NPROCESSORS",
1817
"Oopt",
18+
"PCAPIO",
1919
"PROTO",
2020
"RCVBT",
2121
"RHASH",
@@ -113,6 +113,7 @@
113113
"fpout",
114114
"fproot",
115115
"frnum",
116+
"fstring",
116117
"gaocegege",
117118
"gbhdr",
118119
"genc",

pcapkit/all.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
1010
"""
1111
import pcapkit.const as const
12-
# import pcapkit.vendor as vendor
12+
#import pcapkit.vendor as vendor
1313
from pcapkit.corekit import *
1414
from pcapkit.dumpkit import *
1515
from pcapkit.foundation import *
@@ -32,7 +32,7 @@
3232
'VersionInfo', # Version
3333

3434
# pcapkit.dumpkit
35-
'PCAP', # PCAP Dumper
35+
'PCAPIO', # PCAP Dumper
3636
'NotImplementedIO', # Simulated I/O
3737

3838
# pcapkit.foundation

pcapkit/dumpkit/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from pcapkit.protocols.pcap.frame import Frame
1414
from pcapkit.protocols.pcap.header import Header
1515

16-
__all__ = ['PCAP', 'NotImplementedIO']
16+
__all__ = ['PCAPIO', 'NotImplementedIO']
1717

1818

1919
class NotImplementedIO(dictdumper.Dumper):
@@ -70,7 +70,7 @@ def _append_value(self, value, file, name): # pylint: disable=unused-argument
7070
"""
7171

7272

73-
class PCAP(dictdumper.Dumper):
73+
class PCAPIO(dictdumper.Dumper):
7474
"""PCAP file dumper."""
7575

7676
##########################################################################

pcapkit/foundation/extraction.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
# CPU number
9191
if os.name == 'posix' and 'SC_NPROCESSORS_CONF' in os.sysconf_names:
9292
CPU_CNT = os.sysconf('SC_NPROCESSORS_CONF')
93-
elif 'sched_getaffinity' in os.__all__:
93+
elif 'sched_getaffinity' in os.__all__: # type: ignore
9494
CPU_CNT = len(os.sched_getaffinity(0)) # pylint: disable=E1101
9595
else:
9696
CPU_CNT = os.cpu_count() or 1
@@ -1417,7 +1417,7 @@ def _analyse_frame(*, frame, mpkit):
14171417
"""Analyse frame."""
14181418
# wait until ready
14191419
while mpkit.current != self._frnum:
1420-
time.sleep(random.randint(0, datetime.datetime.now().second) // 600)
1420+
time.sleep(random.randint(0, datetime.datetime.now().second) // 600) # nosec
14211421

14221422
# analysis and storage
14231423
# print(self._frnum, 'get')

pcapkit/foundation/traceflow.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ def make_fout(fout='./tmp', fmt='pcap'):
130130
fout = './tmp'
131131

132132
if fmt == 'pcap': # output PCAP file
133-
from pcapkit.dumpkit import PCAP as output
133+
from pcapkit.dumpkit import PCAPIO as output
134134
elif fmt == 'plist': # output PLIST file
135135
from dictdumper import PLIST as output
136136
elif fmt == 'json': # output JSON file

pcapkit/utilities/exceptions.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
from pcapkit.utilities.compat import ModuleNotFoundError # pylint: disable=redefined-builtin
1919

2020
__all__ = [
21+
'stacklevel',
22+
2123
'BaseError', # Exception
2224
'DigitError', 'IntError', 'RealError', 'ComplexError', # TypeError
2325
'BoolError', 'BytesError', 'StringError', 'BytearrayError', # TypeError

pcapkit/vendor/default.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ def _request(self):
376376

377377
while True:
378378
with contextlib.suppress(Exception):
379-
input('Press ENTER to continue...')
379+
input('Press ENTER to continue...') # nosec
380380
if os.path.isfile(temp_file):
381381
break
382382
print('File not found; please save the page source at')

0 commit comments

Comments
 (0)