checkpackagelib: fix Python3 execution
PATCH 1/1 checkpackagelib: fix Python3 execution
From: Thomas De Schampheleire <[email protected]>
The relative imports do not work in Python 3. Adding the leading dot works both in Python2 and Python3.
This may cause problems if ever you would try to call the helper .py files directly, but this is not currently needed/supported.
--- utils/checkpackagelib/lib.py | 2 +- utils/checkpackagelib/lib_config.py | 10 +++++----- utils/checkpackagelib/lib_hash.py | 10 +++++----- utils/checkpackagelib/lib_mk.py | 10 +++++----- utils/checkpackagelib/lib_patch.py | 4 ++-- 5 files changed, 18 insertions(+), 18 deletions(-)
utils/checkpackagelib/lib.py +1 -1
@@ -1,6 +1,6 @@ # See utils/checkpackagelib/readme.txt before editing this file. -from base import _CheckFunction +from .base import _CheckFunction class ConsecutiveEmptyLines(_CheckFunction):
utils/checkpackagelib/lib_config.py +5 -5
@@ -5,11 +5,11 @@ import re -from base import _CheckFunction -from lib import ConsecutiveEmptyLines # noqa: F401 -from lib import EmptyLastLine # noqa: F401 -from lib import NewlineAtEof # noqa: F401 -from lib import TrailingSpace # noqa: F401 +from .base import _CheckFunction +from .lib import ConsecutiveEmptyLines # noqa: F401 +from .lib import EmptyLastLine # noqa: F401 +from .lib import NewlineAtEof # noqa: F401 +from .lib import TrailingSpace # noqa: F401 def _empty_or_comment(text):
utils/checkpackagelib/lib_hash.py +5 -5
@@ -5,11 +5,11 @@ import re -from base import _CheckFunction -from lib import ConsecutiveEmptyLines # noqa: F401 -from lib import EmptyLastLine # noqa: F401 -from lib import NewlineAtEof # noqa: F401 -from lib import TrailingSpace # noqa: F401 +from .base import _CheckFunction +from .lib import ConsecutiveEmptyLines # noqa: F401 +from .lib import EmptyLastLine # noqa: F401 +from .lib import NewlineAtEof # noqa: F401 +from .lib import TrailingSpace # noqa: F401 def _empty_line_or_comment(text):
utils/checkpackagelib/lib_mk.py +5 -5
@@ -6,11 +6,11 @@ import re -from base import _CheckFunction -from lib import ConsecutiveEmptyLines # noqa: F401 -from lib import EmptyLastLine # noqa: F401 -from lib import NewlineAtEof # noqa: F401 -from lib import TrailingSpace # noqa: F401 +from .base import _CheckFunction +from .lib import ConsecutiveEmptyLines # noqa: F401 +from .lib import EmptyLastLine # noqa: F401 +from .lib import NewlineAtEof # noqa: F401 +from .lib import TrailingSpace # noqa: F401 class Indent(_CheckFunction):
utils/checkpackagelib/lib_patch.py +2 -2
@@ -5,8 +5,8 @@ import re -from base import _CheckFunction -from lib import NewlineAtEof # noqa: F401 +from .base import _CheckFunction +from .lib import NewlineAtEof # noqa: F401 class ApplyOrder(_CheckFunction):
Signature · 1 line
2.18.1
PATCH 1/1 checkpackagelib: fix Python3 execution
El jue., 10 ene. 2019 a las 21:52, Thomas De Schampheleire (<[email protected]>) escribi?:
Quoted 23 lines
From: Thomas De Schampheleire <[email protected]>
The relative imports do not work in Python 3. Adding the leading dot works both in Python2 and Python3.
This may cause problems if ever you would try to call the helper .py files directly, but this is not currently needed/supported.
Signed-off-by Thomas De Schampheleire <[email protected]>--- utils/checkpackagelib/lib.py | 2 +- utils/checkpackagelib/lib_config.py | 10 +++++----- utils/checkpackagelib/lib_hash.py | 10 +++++----- utils/checkpackagelib/lib_mk.py | 10 +++++----- utils/checkpackagelib/lib_patch.py | 4 ++-- 5 files changed, 18 insertions(+), 18 deletions(-)utils/checkpackagelib/lib.py +0
-0
utils/checkpackagelib/lib.py line 3
Quoted 4 lines
utils/checkpackagelib/lib.py +1
-1@@ -1,6 +1,6 @@ # See utils/checkpackagelib/readme.txt before editing this file. -from base import _CheckFunction +from .base import _CheckFunction
It's also possible to replace all these imports with:
from checkpackagelib.base import ...
I.e. use an absolute import. If you like it better...
/Thomas
PATCH 1/1 checkpackagelib: fix Python3 execution
In reply to Thomas De SchampheleireHello,
Quoted 5 lines · Thomas De Schampheleire
The relative imports do not work in Python 3. Adding the leading dot works both in Python2 and Python3.
This may cause problems if ever you would try to call the helper .py files directly, but this is not currently needed/supported.
Could you review this one instead?
http://patchwork.ozlabs.org/patch/956517/
Regards,
Ricardo
PATCH 1/1 checkpackagelib: fix Python3 execution
El vie., 11 ene. 2019 a las 3:53, Ricardo Martincoski (<[email protected]>) escribi?:
Quoted 5 lines
Hello,
On Thu, Jan 10, 2019 at 06:55 PM, Thomas De Schampheleire wrote:
Quoted 10 lines
Quoted 5 lines
The relative imports do not work in Python 3. Adding the leading dot works both in Python2 and Python3.
This may cause problems if ever you would try to call the helper .py files directly, but this is not currently needed/supported.
Could you review this one instead?
http://patchwork.ozlabs.org/patch/956517/
Done, thanks for pointing me to it.
/Thomas