Mercurial > p > roundup > code
diff roundup/cgi/templating.py @ 5809:936275dfe1fa
Try to fix:
DeprecationWarning: invalid escape sequence \d
DeprecationWarning: invalid escape sequence \s
DeprecationWarning: invalid escape sequence \)
Strings under python 3 are unicode strings rather then "regular"
strings as under python 2. So all regexps need to be raw strings.
We will see how many I fixed and if I broke any.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Wed, 12 Jun 2019 20:34:47 -0400 |
| parents | 1a835db41674 |
| children | 883c9e90b403 |
line wrap: on
line diff
--- a/roundup/cgi/templating.py Wed Jun 12 19:52:29 2019 -0400 +++ b/roundup/cgi/templating.py Wed Jun 12 20:34:47 2019 -0400 @@ -376,7 +376,7 @@ m.append(HTMLClass(self._client, item)) return m -num_re = re.compile('^-?\d+$') +num_re = re.compile(r'^-?\d+$') def lookupIds(db, prop, ids, fail_ok=0, num_re=num_re, do_lookup=True): """ "fail_ok" should be specified if we wish to pass through bad values @@ -932,7 +932,7 @@ # XXX do this return [] - def history(self, direction='descending', dre=re.compile('^\d+$'), + def history(self, direction='descending', dre=re.compile(r'^\d+$'), limit=None, showall=False ): """Create an html view of the journal for the item.
