scName=sys.argv[0]
これだけで済むはずのコードが
cmdline = os.environ.get('IBM_JAVA_COMMAND_LINE')
if up1frame == topframe and cmdline and not topframe.f_globals.get('__file__'):
beg = 0
end = len(cmdline)
# Throw away everything after the '--', if present.
dashdash = cmdline.find('--', beg, end)
if dashdash >= 0:
end = dashdash
# If we can't find a filename, just use a "-"
mainfile = '-'
dashf = cmdline.rfind(' -f ', beg, end)
if dashf:
# Grab everything from after the "-f" to the following space.
beg = dashf + 4
space = cmdline.find(' ', beg, end)
if space >= 0:
end = space
mainfile = cmdline[beg:end]
scName=mainfile
websphere V7 のjythonではこうなる。
はっきり言って役に立つとは思えないが
血圧増加大な効果を喰らうのは俺だけでいい。
参考までに記録しておく
http://dbrand666.wordpress.com/2010/04/13/fix5/
http://alvinabad.wordpress.com/2008/05/28/jython-in-webspheres-wsadmin-broke-sysargv/


