From d7e0973808d4b2dfd6ce8bbd34e71b6ee9cb0ce7 Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Mon, 18 Jun 2018 00:50:47 +0000 Subject: [PATCH 50/54] Python 3 preparation: avoid string.find. --- roundup/cgi/templating.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roundup/cgi/templating.py b/roundup/cgi/templating.py index 6fb6cbd..b8b54c3 100644 --- a/roundup/cgi/templating.py +++ b/roundup/cgi/templating.py @@ -171,7 +171,7 @@ class TALLoaderBase(LoaderBase): 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) -- 2.7.4