Skip to content

Instantly share code, notes, and snippets.

@thatch
Created March 21, 2011 00:22
Show Gist options
  • Save thatch/878821 to your computer and use it in GitHub Desktop.
Save thatch/878821 to your computer and use it in GitHub Desktop.
Diff to diagnose issue 645
diff -r 62c4935c6f63 pygments/util.py
--- a/pygments/util.py Sat Mar 19 20:00:07 2011 -0700
+++ b/pygments/util.py Sun Mar 20 17:22:03 2011 -0700
@@ -120,6 +120,8 @@
return min(1.0, max(0.0, float(rv)))
except ValueError:
return 0.0
+ except TypeError:
+ raise TypeError("Error analyzing %r %r %r" % (f, rv, text))
text_analyse.__doc__ = f.__doc__
return staticmethod(text_analyse)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment