Don't report error if position is not set
authorVitja Makarov <vitja.makarov@gmail.com>
Wed, 13 Apr 2011 15:01:33 +0000 (19:01 +0400)
committerVitja Makarov <vitja.makarov@gmail.com>
Thu, 14 Apr 2011 09:07:14 +0000 (13:07 +0400)
Cython/Compiler/Errors.py

index c50f0230893593370a5df6ad0734babe1d9ce3f7..025d1a6e00788c6cf770c233508dec341752b42a 100644 (file)
@@ -176,7 +176,7 @@ def message(position, message, level=1):
 def warning(position, message, level=0):
     if level < LEVEL:
         return
-    if Options.warning_errors:
+    if Options.warning_errors and position:
         return error(position, message)
     warn = CompileWarning(position, message)
     line = "warning: %s\n" % warn