Mercurial > p > roundup > code
changeset 5423:58057ea53779
Python 3 preparation: avoid string.find.
| author | Joseph Myers <jsm@polyomino.org.uk> |
|---|---|
| date | Wed, 25 Jul 2018 09:30:41 +0000 |
| parents | a0ed8d5d744f |
| children | fd0481aa17b8 |
| files | roundup/cgi/templating.py |
| diffstat | 1 files changed, 1 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/roundup/cgi/templating.py Wed Jul 25 09:29:34 2018 +0000 +++ b/roundup/cgi/templating.py Wed Jul 25 09:30:41 2018 +0000 @@ -171,7 +171,7 @@ f = name + extension src = os.path.join(realsrc, f) realpath = os.path.realpath(src) - if string.find(realpath, realsrc) != 0: + if not realpath.startswith(realsrc): return # will raise invalid template if os.path.exists(src): return (src, f)
