From 44546ef04d02e8f6a1695266d3f8dc97e7aac41d Mon Sep 17 00:00:00 2001 From: Jeremy Stanley Date: Mon, 19 Sep 2016 15:25:18 +0000 Subject: [PATCH] Correct setpath search order Short-circuit the outer loop in setpath testing so that we stop iterating through supplied path elements once a match is found. --- weather.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/weather.py b/weather.py index 48bb8d1..d00f7ff 100644 --- a/weather.py +++ b/weather.py @@ -692,6 +692,8 @@ def data_index(path): os.stat(candidate).st_mtime ) break + if filename in datafiles: + break return datafiles def guess( -- 2.11.0