X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=plcsh;h=6b0761987110ccae44442c64d03978f617079f63;hb=691e6d7bea3ffd4d7e4acd4f687e7679e3b75b4d;hp=438737289c1d6fac9d5420b12e70f7cf732f70b1;hpb=33b67b9d88e55836b183cc0ac6e9268d7c30dc21;p=plcapi.git diff --git a/plcsh b/plcsh index 4387372..6b07619 100755 --- a/plcsh +++ b/plcsh @@ -32,7 +32,8 @@ parser.add_option("-s", "--session", help = "API session key") parser.add_option("-u", "--user", help = "API user name") parser.add_option("-p", "--password", help = "API password") parser.add_option("-r", "--role", help = "API role") -parser.add_option("-x", "--xmlrpc", action = "store_true", default = False, help = "Use XML-RPC interface") +parser.add_option("-x", "--xmlrpc", action = "store_true", + default = False, help = "Use XML-RPC interface") # pass this to the invoked shell if any parser.add_option("--help", action = "store_true", dest="help", default=False, help = "show this help message and exit") @@ -85,7 +86,8 @@ if args: # Add of script to sys.path path = os.path.dirname(os.path.abspath(script)) sys.path.append(path) - exec(compile(open(script).read(), script, 'exec')) + with open(script) as feed: + exec(script.read()) # Otherwise, run an interactive shell environment else: