Fix scons -v on win32. (Anthony Roach)
authorstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Fri, 12 Jul 2002 06:00:46 +0000 (06:00 +0000)
committerstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Fri, 12 Jul 2002 06:00:46 +0000 (06:00 +0000)
git-svn-id: http://scons.tigris.org/svn/scons/trunk@410 fdb21ef1-2011-0410-befe-b5e4ea1792b1

src/engine/SCons/Script/__init__.py
test/option-v.py

index 306b89b27119ba147479a96956538da8e4bfb0ae..6f87353911f339fd656c3727c57dcd737966892c 100644 (file)
@@ -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__,
index 4adcf5ea9eb5315c0835645f21824e204c568707..a0f7d93851e8ad5cb4ebfe50e52103832aa0d6ca 100644 (file)
@@ -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