From: stevenknight Date: Fri, 12 Jul 2002 06:00:46 +0000 (+0000) Subject: Fix scons -v on win32. (Anthony Roach) X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=812a9de5c9deca5461671011ef324980e91f32e1;p=scons.git Fix scons -v on win32. (Anthony Roach) git-svn-id: http://scons.tigris.org/svn/scons/trunk@410 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- diff --git a/src/engine/SCons/Script/__init__.py b/src/engine/SCons/Script/__init__.py index 306b89b2..6f873539 100644 --- a/src/engine/SCons/Script/__init__.py +++ b/src/engine/SCons/Script/__init__.py @@ -679,11 +679,16 @@ def options_init(): import __main__ import SCons print "SCons by Steven Knight et al.:" - print "\tscript: v%s.%s, %s, by %s on %s" % (__main__.__version__, - __main__.__build__, - __main__.__date__, - __main__.__developer__, - __main__.__buildsys__) + try: + print "\tscript: v%s.%s, %s, by %s on %s" % (__main__.__version__, + __main__.__build__, + __main__.__date__, + __main__.__developer__, + __main__.__buildsys__) + except: + # On win32 there is no scons.py, so there is no __main__.__version__, + # hence there is no script version. + pass print "\tengine: v%s.%s, %s, by %s on %s" % (SCons.__version__, SCons.__build__, SCons.__date__, diff --git a/test/option-v.py b/test/option-v.py index 4adcf5ea..a0f7d938 100644 --- a/test/option-v.py +++ b/test/option-v.py @@ -33,7 +33,13 @@ test = TestSCons.TestSCons(match = TestCmd.match_re) test.write('SConstruct', "") -expect = r"""SCons by Steven Knight et al.: +if sys.platform == 'win32': + expect = r"""SCons by Steven Knight et al.: +\tengine: v\S+, [^,]*, by \S+ on \S+ +Copyright 2001, 2002 Steven Knight +""" +else: + expect = r"""SCons by Steven Knight et al.: \tscript: v\S+, [^,]*, by \S+ on \S+ \tengine: v\S+, [^,]*, by \S+ on \S+ Copyright 2001, 2002 Steven Knight