Greetings,

The following patch is to fix this issue:

  16627 syntax check would be much more friendly if stringified

This simply formats syntax errors thrown during the pkg gate build process in a bit friendlier fashion:

Before:
    failed syntax check: SyntaxError: ('invalid syntax',
('modules/client/actuator.py', 131, 9, '        }\n'))

After:
error: invalid syntax
modules/client/actuator.py: 130: 9:
        }


diff -r 01699e7cb9d9 src/setup.py
--- a/src/setup.py      Fri Feb 25 15:09:57 2011 -0800
+++ b/src/setup.py      Mon Feb 28 14:11:48 2011 -0800
@@ -696,8 +696,15 @@
         try:
                 py_compile.compile(filename, os.devnull, doraise=True)
         except py_compile.PyCompileError, e:
-                raise DistutilsError("%s: failed syntax check: %s" %
-                    (filename, e))
+                res = ""
+                for err in e.exc_value:
+                        if isinstance(err, basestring):
+                                res += err + "\n"
+                                continue
+ res += (": ".join(str(entry) for entry in err[:-1])) + \
+                            ":\n"
+                        res += err[-1]
+                raise DistutilsError(res)


 class build_py_func(_build_py):



_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss

Reply via email to