Pārlūkot izejas kodu

Assert 'here' is not None rather than ignoring it
If '%(here)s' is found in the config file but the variable 'here' is
not a path string, it is either a bug or a test setup issue.

Mike Naberezny 9 gadi atpakaļ
vecāks
revīzija
b01795e8ab
1 mainītis faili ar 1 papildinājumiem un 2 dzēšanām
  1. 1 2
      supervisor/options.py

+ 1 - 2
supervisor/options.py

@@ -1747,12 +1747,11 @@ class UnhosedConfigParser(ConfigParser.RawConfigParser):
                             expansions=expansions, **kwargs)
 
     def expand_here(self, here):
-        if here is None:
-            return
         HERE_FORMAT = '%(here)s'
         for section in self.sections():
             for key, value in self.items(section):
                 if HERE_FORMAT in value:
+                    assert here is not None, "here has not been set to a path"
                     value = value.replace(HERE_FORMAT, here)
                     self.set(section, key, value)