# HG changeset patch # User Doug Simon # Date 1417773619 -3600 # Node ID dcf5cd3c6da97e25af949802a0f5d698fc136863 # Parent a8b46348b79fb6bdda3ba218d1673827c79d5382 mx: fixed issue with calling abort() before _opts is defined diff -r a8b46348b79f -r dcf5cd3c6da9 mxtool/mx.py --- a/mxtool/mx.py Fri Dec 05 08:20:06 2014 +0100 +++ b/mxtool/mx.py Fri Dec 05 11:00:19 2014 +0100 @@ -1673,6 +1673,9 @@ opts = self.parse_args() + global _opts + _opts = opts + # Give the timeout options a default value to avoid the need for hasattr() tests opts.__dict__.setdefault('timeout', 0) opts.__dict__.setdefault('ptimeout', 0) @@ -2209,7 +2212,7 @@ the object's value is printed and the exit status is one. """ - if _opts.killwithsigquit: + if _opts and _opts.killwithsigquit: _send_sigquit() def is_alive(p): @@ -5177,9 +5180,9 @@ abort('no primary suite found') opts, commandAndArgs = _argParser._parse_cmd_line() - - global _opts, _java_homes - _opts = opts + assert _opts == opts + + global _java_homes defaultJdk = JavaConfig(opts.java_home, opts.java_dbg_port) _java_homes = [defaultJdk] if opts.extra_java_homes: