Philippe Mathieu-Daudé
3d004a371e
scripts: Explicit usage of Python 3 (scripts with __main__)
...
Use the program search path to find the Python 3 interpreter.
Patch created mechanically by running:
$ sed -i "s,^#\!/usr/bin/\(env\ \)\?python$,#\!/usr/bin/env python3," \
$(git grep -l 'if __name__.*__main__')
Reported-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com >
Suggested-by: Daniel P. Berrangé <berrange@redhat.com >
Suggested-by: Stefan Hajnoczi <stefanha@redhat.com >
Reviewed-by: Juan Quintela <quintela@redhat.com >
Acked-by: Stefan Hajnoczi <stefanha@redhat.com >
Acked-by: Paolo Bonzini <pbonzini@redhat.com >
Message-Id: <20200130163232.10446-6-philmd@redhat.com >
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com >
2020-02-07 15:12:48 +01:00
Eduardo Habkost
bf20b675cc
Partially revert "python: futurize -f libfuturize.fixes.fix_absolute_import"
...
Since commit 068cf7a44c , qmp-shell
is broken:
$ ./scripts/qmp/qmp-shell
Traceback (most recent call last):
File "./scripts/qmp/qmp-shell", line 70, in <module>
from . import qmp
ValueError: Attempted relative import in non-package
Relative imports don't work on scripts that are executed
directly, so revert the change on the scripts inside scripts/qmp.
Fixes: 068cf7a44c
Reported-by: John Snow <jsnow@redhat.com >
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com >
Message-Id: <20180621175451.7948-1-ehabkost@redhat.com >
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com >
2018-06-22 15:45:42 -03:00
Eduardo Habkost
4803c5cde8
python: futurize -f lib2to3.fixes.fix_numliterals
...
Convert octal literals into the new syntax.
This is necessary for Python 3 compatibility.
Done using:
$ py=$( (g grep -l -E '^#!.*python';find -name '*.py' -printf '%P\n';) | \
sort -u | grep -v README.sh4)
$ futurize -w -f lib2to3.fixes.fix_numliterals $py
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com >
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org >
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com >
Message-Id: <20180608122952.2009-11-ehabkost@redhat.com >
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com >
2018-06-08 14:39:24 -03:00
Eduardo Habkost
d7a4228ebb
python: futurize -f lib2to3.fixes.fix_has_key
...
Change "dict.has_key(key)" to "key in dict"
This is necessary for Python 3 compatibility.
Done using:
$ py=$( (g grep -l -E '^#!.*python';find -name '*.py' -printf '%P\n';) | \
sort -u | grep -v README.sh4)
$ futurize -w -f lib2to3.fixes.fix_has_key $py
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com >
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org >
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com >
Message-Id: <20180608122952.2009-5-ehabkost@redhat.com >
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com >
2018-06-08 14:39:24 -03:00
Eduardo Habkost
068cf7a44c
python: futurize -f libfuturize.fixes.fix_absolute_import
...
Make implicit relative imports explicit and add "from __future__ import
absolute_import" at the top of each relevant module.
This is necessary for Python 3 compatibility.
Done using:
$ py=$( (g grep -l -E '^#!.*python';find -name '*.py' -printf '%P\n';) | \
sort -u | grep -v README.sh4)
$ futurize -w -f libfuturize.fixes.fix_absolute_import $py
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com >
Message-Id: <20180608122952.2009-3-ehabkost@redhat.com >
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com >
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com >
2018-06-08 14:39:24 -03:00
Luiz Capitulino
22f3946bc5
QMP: add scripts/qmp
...
Populate it with all scripts stored in QMP/. Also fixes trailing
whitespaces in qmp-shell and qmp.py.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com >
Reviewed-by: Eric Blake <eblake@redhat.com >
2013-09-18 08:57:02 -04:00