summaryrefslogtreecommitdiff
path: root/support
diff options
context:
space:
mode:
authorSamuel Martin <s.martin49@gmail.com>2016-04-17 23:41:48 +0200
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>2016-04-18 11:34:33 +0200
commitac031cfb976980dd68dfb52e7b610b4e6e27fe17 (patch)
treee415acdea974255e0075f7bf69cef3f2f9ea26bb /support
parente3b18f45f7e8d62a501919623c7d675ea00a1654 (diff)
support/scripts: fix graph-depends when run with python3
Make graph-depends script opening the output file in text mode since only ascii characters will be written. This change fixes the following error occuring when the default host python interpreter is python3: make: Entering directory '/opt/buildroot' Getting targets Getting dependencies for ['toolchain-external', 'toolchain', 'busybox', ...] Getting dependencies for ['host-python3', 'host-pkgconf', 'host-gettext', ...] Getting dependencies for ['host-libxml2', 'host-swig', 'host-m4', ...] Getting version for ['toolchain-external', 'toolchain', 'busybox', ...] Traceback (most recent call last): File "/opt/buildroot/support/scripts/graph-depends", line 425, in <module> outfile.write("digraph G {\n") TypeError: a bytes-like object is required, not 'str' Makefile:807: recipe for target 'graph-depends' failed make[1]: *** [graph-depends] Error 1 Makefile:84: recipe for target '_all' failed make: *** [_all] Error 2 make: Leaving directory '/opt/buildroot' While with python2, adding 'b' to the openning mode has no effect on Linux (c.f. [2]), the above error is expected with python3 (c.f. [1]). Therefore, just open the outfile in default (i.e. text) mode. [1] https://docs.python.org/3/library/functions.html#open [2] https://docs.python.org/2/library/functions.html#open Signed-off-by: Samuel Martin <s.martin49@gmail.com> Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'support')
-rwxr-xr-xsupport/scripts/graph-depends2
1 files changed, 1 insertions, 1 deletions
diff --git a/support/scripts/graph-depends b/support/scripts/graph-depends
index a00eb9d47..cb00383c0 100755
--- a/support/scripts/graph-depends
+++ b/support/scripts/graph-depends
@@ -73,7 +73,7 @@ else:
if check_only:
sys.stderr.write("don't specify outfile and check-only at the same time\n")
sys.exit(1)
- outfile = open(args.outfile, "wb")
+ outfile = open(args.outfile, "w")
if args.package is None:
mode = MODE_FULL