[Rpm-maint] [PATCH 04/15] Convert relative imports within rpm package to absolute imports

Panu Matilainen pmatilai at redhat.com
Mon Oct 19 09:26:39 UTC 2009


On Thu, 15 Oct 2009, David Malcolm wrote:
> ---
> python/rpm/__init__.py    |    9 ++++-----
> python/rpm/transaction.py |    2 +-
> 2 files changed, 5 insertions(+), 6 deletions(-)
>
> diff --git a/python/rpm/__init__.py b/python/rpm/__init__.py
> index 49a4c77..3cf59f7 100644
> --- a/python/rpm/__init__.py
> +++ b/python/rpm/__init__.py
> @@ -6,10 +6,9 @@ This module enables you to manipulate rpms and the rpm database.
>
> import warnings
> import os
> -from _rpm import *
> -from transaction import *
> -
> -import _rpm
> +from rpm._rpm import *
> +from rpm.transaction import *
> +import rpm._rpm as _rpm

Well this is a welcome change in Python, I haven't been closely following 
Pythons development in recent years and this has gone unnoticed by me.

AFAICT this is only supported in >= 2.5, and in 2.5 you need __future__ 
import to enable it. But ok, 2.5 is probably quite a reasonable 
compatibility cut-off point for the next non-maintenance rpm release.

 	- Panu -


More information about the Rpm-maint mailing list