comparison mxtool/mx.py @ 18636:dcf5cd3c6da9

mx: fixed issue with calling abort() before _opts is defined
author Doug Simon <doug.simon@oracle.com>
date Fri, 05 Dec 2014 11:00:19 +0100
parents a8b46348b79f
children beb33138029c
comparison
equal deleted inserted replaced
18635:a8b46348b79f 18636:dcf5cd3c6da9
1671 1671
1672 self.add_argument('commandAndArgs', nargs=REMAINDER, metavar='command args...') 1672 self.add_argument('commandAndArgs', nargs=REMAINDER, metavar='command args...')
1673 1673
1674 opts = self.parse_args() 1674 opts = self.parse_args()
1675 1675
1676 global _opts
1677 _opts = opts
1678
1676 # Give the timeout options a default value to avoid the need for hasattr() tests 1679 # Give the timeout options a default value to avoid the need for hasattr() tests
1677 opts.__dict__.setdefault('timeout', 0) 1680 opts.__dict__.setdefault('timeout', 0)
1678 opts.__dict__.setdefault('ptimeout', 0) 1681 opts.__dict__.setdefault('ptimeout', 0)
1679 1682
1680 if opts.very_verbose: 1683 if opts.very_verbose:
2207 If 'codeOrMessage' is a plain integer, it specifies the system exit status; 2210 If 'codeOrMessage' is a plain integer, it specifies the system exit status;
2208 if it is None, the exit status is zero; if it has another type (such as a string), 2211 if it is None, the exit status is zero; if it has another type (such as a string),
2209 the object's value is printed and the exit status is one. 2212 the object's value is printed and the exit status is one.
2210 """ 2213 """
2211 2214
2212 if _opts.killwithsigquit: 2215 if _opts and _opts.killwithsigquit:
2213 _send_sigquit() 2216 _send_sigquit()
2214 2217
2215 def is_alive(p): 2218 def is_alive(p):
2216 if isinstance(p, subprocess.Popen): 2219 if isinstance(p, subprocess.Popen):
2217 return p.poll() is None 2220 return p.poll() is None
5175 _primary_suite = _loadSuite(primarySuiteMxDir, True) 5178 _primary_suite = _loadSuite(primarySuiteMxDir, True)
5176 else: 5179 else:
5177 abort('no primary suite found') 5180 abort('no primary suite found')
5178 5181
5179 opts, commandAndArgs = _argParser._parse_cmd_line() 5182 opts, commandAndArgs = _argParser._parse_cmd_line()
5180 5183 assert _opts == opts
5181 global _opts, _java_homes 5184
5182 _opts = opts 5185 global _java_homes
5183 defaultJdk = JavaConfig(opts.java_home, opts.java_dbg_port) 5186 defaultJdk = JavaConfig(opts.java_home, opts.java_dbg_port)
5184 _java_homes = [defaultJdk] 5187 _java_homes = [defaultJdk]
5185 if opts.extra_java_homes: 5188 if opts.extra_java_homes:
5186 for java_home in opts.extra_java_homes.split(os.pathsep): 5189 for java_home in opts.extra_java_homes.split(os.pathsep):
5187 extraJdk = JavaConfig(java_home, opts.java_dbg_port) 5190 extraJdk = JavaConfig(java_home, opts.java_dbg_port)