From 385c2934c57ad53fdd2823398dab645581c2cf60 Mon Sep 17 00:00:00 2001 From: Fabio Erculiani Date: Fri, 23 Aug 2013 10:57:36 +0200 Subject: [PATCH] [client] deal with Python bug #16308 --- client/kernel-switcher | 5 +++++ client/solo/commands/_manage.py | 4 ++++ client/solo/commands/cache.py | 4 ++++ client/solo/commands/conf.py | 4 ++++ client/solo/commands/pkg.py | 4 ++++ client/solo/commands/query.py | 4 ++++ client/solo/commands/repo.py | 4 ++++ client/solo/commands/rescue.py | 4 ++++ client/solo/commands/security.py | 4 ++++ client/solo/commands/ugc.py | 4 ++++ 10 files changed, 41 insertions(+) diff --git a/client/kernel-switcher b/client/kernel-switcher index f27f6e745..bea18a44c 100755 --- a/client/kernel-switcher +++ b/client/kernel-switcher @@ -163,6 +163,11 @@ if __name__ == "__main__": parser.print_help() raise SystemExit(1) + # Python 3.3 bug #16308 + if not hasattr(nsargs, "func"): + parser.print_help() + raise SystemExit(1) + try: rc = nsargs.func(nsargs) except KeyboardInterrupt: diff --git a/client/solo/commands/_manage.py b/client/solo/commands/_manage.py index 908feb4c0..6133ee33f 100644 --- a/client/solo/commands/_manage.py +++ b/client/solo/commands/_manage.py @@ -61,6 +61,10 @@ class SoloManage(SoloCommand): sys.stderr.write("%s\n" % (err,)) return parser.print_help, [] + # Python 3.3 bug #16308 + if not hasattr(nsargs, "func"): + return parser.print_help, [] + self._nsargs = nsargs return self._call_locked, [nsargs.func] diff --git a/client/solo/commands/cache.py b/client/solo/commands/cache.py index 5b1a45694..d4b2129ca 100644 --- a/client/solo/commands/cache.py +++ b/client/solo/commands/cache.py @@ -86,6 +86,10 @@ Manage Entropy Library Cache. sys.stderr.write("%s\n" % (err,)) return parser.print_help, [] + # Python 3.3 bug #16308 + if not hasattr(nsargs, "func"): + return parser.print_help, [] + self._nsargs = nsargs return self._call_locked, [nsargs.func] diff --git a/client/solo/commands/conf.py b/client/solo/commands/conf.py index 45b5ca1ee..dbf79fb5d 100644 --- a/client/solo/commands/conf.py +++ b/client/solo/commands/conf.py @@ -94,6 +94,10 @@ Manage package file updates. sys.stderr.write("%s\n" % (err,)) return parser.print_help, [] + # Python 3.3 bug #16308 + if not hasattr(nsargs, "func"): + return parser.print_help, [] + self._nsargs = nsargs return self._call_locked, [nsargs.func] diff --git a/client/solo/commands/pkg.py b/client/solo/commands/pkg.py index d9757535d..040ee1828 100644 --- a/client/solo/commands/pkg.py +++ b/client/solo/commands/pkg.py @@ -169,6 +169,10 @@ Execute advanced tasks on Entropy packages and the running system. sys.stderr.write("%s\n" % (err,)) return parser.print_help, [] + # Python 3.3 bug #16308 + if not hasattr(nsargs, "func"): + return parser.print_help, [] + self._nsargs = nsargs return self._call_locked, [nsargs.func] diff --git a/client/solo/commands/query.py b/client/solo/commands/query.py index 388e3a261..65c772269 100644 --- a/client/solo/commands/query.py +++ b/client/solo/commands/query.py @@ -329,6 +329,10 @@ Repository query tools. sys.stderr.write("%s\n" % (err,)) return parser.print_help, [] + # Python 3.3 bug #16308 + if not hasattr(nsargs, "func"): + return parser.print_help, [] + self._nsargs = nsargs return self._call_locked, [nsargs.func] diff --git a/client/solo/commands/repo.py b/client/solo/commands/repo.py index cf8330a6f..50c3ff17f 100644 --- a/client/solo/commands/repo.py +++ b/client/solo/commands/repo.py @@ -171,6 +171,10 @@ Manage Entropy Repositories. sys.stderr.write("%s\n" % (err,)) return parser.print_help, [] + # Python 3.3 bug #16308 + if not hasattr(nsargs, "func"): + return parser.print_help, [] + self._nsargs = nsargs return self._call_locked, [nsargs.func] diff --git a/client/solo/commands/rescue.py b/client/solo/commands/rescue.py index fc568dd4f..f4a96909d 100644 --- a/client/solo/commands/rescue.py +++ b/client/solo/commands/rescue.py @@ -150,6 +150,10 @@ Tools to rescue the running system. sys.stderr.write("%s\n" % (err,)) return parser.print_help, [] + # Python 3.3 bug #16308 + if not hasattr(nsargs, "func"): + return parser.print_help, [] + self._nsargs = nsargs return self._call_locked, [nsargs.func] diff --git a/client/solo/commands/security.py b/client/solo/commands/security.py index 16c606dcd..c7336a6c3 100644 --- a/client/solo/commands/security.py +++ b/client/solo/commands/security.py @@ -190,6 +190,10 @@ System security tools. sys.stderr.write("%s\n" % (err,)) return parser.print_help, [] + # Python 3.3 bug #16308 + if not hasattr(nsargs, "func"): + return parser.print_help, [] + self._nsargs = nsargs return self._call_locked, [nsargs.func] diff --git a/client/solo/commands/ugc.py b/client/solo/commands/ugc.py index f781e3202..c92fbd66d 100644 --- a/client/solo/commands/ugc.py +++ b/client/solo/commands/ugc.py @@ -173,6 +173,10 @@ Manage User Generate Content (votes, comments, files). sys.stderr.write("%s\n" % (err,)) return parser.print_help, [] + # Python 3.3 bug #16308 + if not hasattr(nsargs, "func"): + return parser.print_help, [] + self._nsargs = nsargs return self._call_locked, [nsargs.func]