Skip to content

Commit 66f0cbe

Browse files
Auto-prettify c290aca (#385)
Co-authored-by: ccascone <ccascone@users.noreply.github.com>
1 parent c290aca commit 66f0cbe

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

ptf/tests/common/xnt.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55

66
import logging
77
import os
8+
import pickle
89
from os.path import abspath, exists, splitext
910
from subprocess import Popen
10-
import pickle
1111

1212
import matplotlib.pyplot as plt
1313
import numpy as np
@@ -350,23 +350,24 @@ def analyze_report_pcap(pcap_file: str, total_flows_from_trace: int = 0) -> dict
350350

351351

352352
def pypy_analyze_int_report_pcap(pcap_file: str, total_flows: int = 0) -> dict:
353-
code = "import pickle\n" \
354-
"from xnt import analyze_report_pcap\n"
353+
code = "import pickle\n" "from xnt import analyze_report_pcap\n"
355354

356355
if total_flows:
357356
code += f"result = analyze_report_pcap('{pcap_file}', {total_flows})\n"
358357
else:
359358
code += f"result = analyze_report_pcap('{pcap_file}')\n"
360359

361360
# pickle dictionary from analyze_report_pcap
362-
code += "with open('trace.pickle', 'wb') as handle:\n" \
363-
" pickle.dump(result, handle, protocol=pickle.HIGHEST_PROTOCOL)"
361+
code += (
362+
"with open('trace.pickle', 'wb') as handle:\n"
363+
" pickle.dump(result, handle, protocol=pickle.HIGHEST_PROTOCOL)"
364+
)
364365

365366
cmd = ["pypy", "-c", code]
366367
p = Popen(cmd)
367368
p.wait()
368369

369-
with open('trace.pickle', 'rb') as handle:
370+
with open("trace.pickle", "rb") as handle:
370371
result = pickle.load(handle)
371372

372373
return result

0 commit comments

Comments
 (0)