1. clach04
  2. geriatric_pottymouth


clach04  committed 8bf82ca Draft

Change white space string declaration to no longer use regex escape sequence.

Main reason is that Jython 2.2.1 messes this up, the string is a Unicode Regex. Converted to use regular escape (Unicode) string sequence.

Results before:

Ran 72 tests in 3.569s

FAILED (failures=16, errors=18)

Results after:

Ran 72 tests in 2.378s

FAILED (failures=1, errors=18)

  • Participants
  • Parent commits 15c0c54
  • Branches python_pre2.6

Comments (0)

Files changed (1)

File python/pottymouth.py

View file
  • Ignore whitespace
 youtube_matcher = re.compile(youtube_pattern, re.IGNORECASE)
 # Unicode whitespace, not including newlines
-white = ur'[ \t\xa0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000]'
+white = u'[ \\t\\xa0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]'
 token_order = (
     TokenMatcher('NEW_LINE'   , r'(\r?\n)(' + white + '*)'), #fuck you, Microsoft!