]> granicus.if.org Git - python/commitdiff
- Slightly better error message in case of syntax errors in the script.
authorJack Jansen <jack.jansen@cwi.nl>
Fri, 2 Aug 2002 14:04:15 +0000 (14:04 +0000)
committerJack Jansen <jack.jansen@cwi.nl>
Fri, 2 Aug 2002 14:04:15 +0000 (14:04 +0000)
- The applet .rsrc file should be called python.rsrc, it is not based on the
  applet name.

Mac/Lib/buildtools.py

index efc5c47eddca1ec5bd039b492d1916ce436b138f..982570855b65fe45a544b39754f977c9c4847b78 100644 (file)
@@ -83,8 +83,10 @@ def process(template, filename, destname, copy_codefragment,
        fp.close()
        try:
                code = compile(text, filename, "exec")
-       except (SyntaxError, EOFError):
-               raise BuildError, "Syntax error in script %s" % `filename`
+       except SyntaxError, arg:
+               raise BuildError, "Syntax error in script %s: %s" % (filename, arg)
+       except EOFError:
+               raise BuildError, "End-of-file in script %s" % (filename,)
        
        # Set the destination file name. Note that basename
        # does contain the whole filepath, only a .py is stripped.
@@ -341,7 +343,7 @@ def process_common_macho(template, progress, code, rsrcname, destname, is_update
        if progress:
                progress.label("Copy resources...")
                progress.set(20)
-       resfilename = '%s.rsrc' % shortname
+       resfilename = 'python.rsrc'  # XXXX later: '%s.rsrc' % shortname
        try:
                output = Res.FSOpenResourceFile(
                                os.path.join(destname, 'Contents', 'Resources', resfilename),