[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 2/4] tracetool: use Python 2.4-compatible __impo
From: |
Lluís Vilanova |
Subject: |
Re: [Qemu-devel] [PATCH 2/4] tracetool: use Python 2.4-compatible __import__() arguments |
Date: |
Fri, 27 Apr 2012 19:32:31 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux) |
Stefan Hajnoczi writes:
> In Python 2.5 keyword arguments were added to __import__(). Avoid using
> them to achieve Python 2.4 compatibility.
> Signed-off-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Lluís Vilanova <address@hidden>
> ---
> scripts/tracetool/__init__.py | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> diff --git a/scripts/tracetool/__init__.py b/scripts/tracetool/__init__.py
> index 74fe21b..49858c9 100644
> --- a/scripts/tracetool/__init__.py
> +++ b/scripts/tracetool/__init__.py
> @@ -204,7 +204,7 @@ def try_import(mod_name, attr_name = None, attr_default =
> None):
> object or attribute value.
> """
> try:
> - module = __import__(mod_name, fromlist=["__package__"])
> + module = __import__(mod_name, globals(), locals(), ["__package__"])
> if attr_name is None:
> return True, module
> return True, getattr(module, str(attr_name), attr_default)
> --
> 1.7.10
--
"And it's much the same thing with knowledge, for whenever you learn
something new, the whole world becomes that much richer."
-- The Princess of Pure Reason, as told by Norton Juster in The Phantom
Tollbooth
- [Qemu-devel] [PATCH 0/4] tracetool: Python 2.4 compatibility fixes, Stefan Hajnoczi, 2012/04/27
- [Qemu-devel] [PATCH 2/4] tracetool: use Python 2.4-compatible __import__() arguments, Stefan Hajnoczi, 2012/04/27
- Re: [Qemu-devel] [PATCH 2/4] tracetool: use Python 2.4-compatible __import__() arguments,
Lluís Vilanova <=
- [Qemu-devel] [PATCH 3/4] tracetool: avoid str.rpartition() Python 2.5 function, Stefan Hajnoczi, 2012/04/27
- [Qemu-devel] [PATCH 4/4] configure: check for supported Python 2.x versions, Stefan Hajnoczi, 2012/04/27
- [Qemu-devel] [PATCH 1/4] tracetool: use Python 2.4-compatible exception handling syntax, Stefan Hajnoczi, 2012/04/27
- Re: [Qemu-devel] [PATCH 0/4] tracetool: Python 2.4 compatibility fixes, Andreas Färber, 2012/04/28
- Re: [Qemu-devel] [PATCH 0/4] tracetool: Python 2.4 compatibility fixes, Erik Rull, 2012/04/29