From: Jeremy Stanley Date: Mon, 19 Sep 2016 15:25:18 +0000 (+0000) Subject: Correct setpath search order X-Git-Tag: 2.2~3 X-Git-Url: https://yuggoth.org/gitweb?a=commitdiff_plain;h=44546ef04d02e8f6a1695266d3f8dc97e7aac41d;p=weather.git 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. --- 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(