HellerCommaA / endgame-singularity

Automatically exported from code.google.com/p/endgame-singularity
0 stars 0 forks source link

SyntaxError: invalid syntax in code/g.py #113

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. download singularity-0.30b or check out trunk from SVN (revision 965)
2. start Endgame_Linux
3. game crashes before starting:
$ ./Endgame_Linux 
Traceback (most recent call last):
  File "singularity.py", line 1, in <module>
    import code.singularity
  File "/tmp/singularity/endgame-singularity-read-only/code/singularity.py", line 38, in <module>
    import g, graphics.g
  File "/tmp/singularity/endgame-singularity-read-only/code/g.py", line 748
    except Exception as reason:
                      ^
SyntaxError: invalid syntax

What is the expected output? What do you see instead?
expected output is the actual game.  Instead I get the above stack trace

What version of the product are you using? On what operating system?
 singularity-0.30b/ and revision 965 from SVN
Both on Fedora release 10 x86_64

Please provide any additional information below.
After removing the 'as reason' syntax the game starts.

Here is the svn diff:
$ svn diff
Index: code/g.py
===================================================================
--- code/g.py   (revision 965)
+++ code/g.py   (working copy)
@@ -745,8 +745,8 @@
     filename = os.path.join(data_loc, file)
     try:
         config.readfp(open(filename, "r"))
-    except Exception as reason:
-        sys.stderr.write("Cannot open %s for reading! (%s)\n" % (filename, 
reason))
+    except Exception:
+        sys.stderr.write("Cannot open %s for reading! (%s)\n" % (filename, 
Exception))
         sys.exit(1)

     return_list = []
@@ -1200,8 +1200,8 @@
     try:
         pygame.mixer.quit()
         pygame.mixer.init(48000, -16, 2, soundbuf)
-    except Exception as reason:
-        sys.stderr.write("Failure starting sound system. Disabling. (%s)\n" % 
reason)
+    except Exception:
+        sys.stderr.write("Failure starting sound system. Disabling. (%s)\n" % 
Exception)
         nosound = 1

 def available_languages():

Original issue reported on code.google.com by mertensb...@gmail.com on 13 Aug 2010 at 10:04

GoogleCodeExporter commented 9 years ago
I suspect this comes from the fact that Fedora 10 didn't provide Python 2.6, 
which is probably required nowadays.  This is a pretty small change, but I 
think there are enough other things in older Pythons we want to avoid, so I'm 
marking this WontFix.  Feel free to argue otherwise :)

Original comment by phil.bor...@gmail.com on 29 Mar 2012 at 6:59

GoogleCodeExporter commented 9 years ago
Fedora 10 End of Life was aeons ago, so I don't think this is an issue anymore 
with any supported distro.

Original comment by rodrigo....@gmail.com on 29 Mar 2012 at 9:19