void-packages/srcpkgs/linux4.14/patches/python3.patch

82 lines
2.1 KiB
Diff
Raw Normal View History

2023-09-28 07:22:31 +02:00
--- a/scripts/show_delta
+++ b/scripts/show_delta
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
#
# show_deltas: Read list of printk messages instrumented with
# time data, and format with time deltas.
@@ -13,7 +13,7 @@
import string
def usage():
- print ("""usage: show_delta [<options>] <filename>
+ print("""usage: show_delta [<options>] <filename>
This program parses the output from a set of printk message lines which
have time data prefixed because the CONFIG_PRINTK_TIME option is set, or
@@ -46,8 +46,8 @@
raise ValueError
# split on closing bracket
- (time_str, rest) = string.split(line[1:],']',1)
- time = string.atof(time_str)
+ (time_str, rest) = line[1:].split(']',1)
+ time = float(time_str)
#print "time=", time
return (time, rest)
@@ -94,11 +94,11 @@
try:
lines = open(filein,"r").readlines()
except:
- print ("Problem opening file: %s" % filein)
+ print("Problem opening file: %s" % filein)
sys.exit(1)
if base_str:
- print ('base= "%s"' % base_str)
+ print('base= "%s"' % base_str)
# assume a numeric base. If that fails, try searching
# for a matching line.
try:
@@ -111,18 +111,18 @@
(time, rest) = get_time(line)
except:
continue
- if string.find(rest, base_str)==1:
+ if rest.find(base_str)==1:
base_time = time
found = 1
# stop at first match
break
if not found:
- print ('Couldn\'t find line matching base pattern "%s"' % base_str)
+ print('Couldn\'t find line matching base pattern "%s"' % base_str)
sys.exit(1)
else:
base_time = 0.0
for line in lines:
- print (convert_line(line, base_time),)
+ print(convert_line(line, base_time))
main()
--- a/scripts/tracing/draw_functrace.py
+++ b/scripts/tracing/draw_functrace.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
"""
Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com>
@@ -123,7 +123,7 @@
tree = tree.getParent(caller)
tree = tree.calls(callee, calltime)
- print CallTree.ROOT
+ print(CallTree.ROOT)
if __name__ == "__main__":
main()