diff options
Diffstat (limited to 'debian/lib/python/debian_linux/utils.py')
-rw-r--r-- | debian/lib/python/debian_linux/utils.py | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/debian/lib/python/debian_linux/utils.py b/debian/lib/python/debian_linux/utils.py index 563104ed3dce..454d7c8e8e7b 100644 --- a/debian/lib/python/debian_linux/utils.py +++ b/debian/lib/python/debian_linux/utils.py @@ -19,13 +19,14 @@ class Templates(object): def _read(self, name): prefix, id = name.split('.', 1) - for dir in self.dirs: - filename = "%s/%s.in" % (dir, name) - if os.path.exists(filename): - f = codecs.open(filename, 'r', 'utf-8') - if prefix == 'control': - return read_control(f) - return f.read() + for suffix in ['.in', '']: + for dir in self.dirs: + filename = "%s/%s%s" % (dir, name, suffix) + if os.path.exists(filename): + f = codecs.open(filename, 'r', 'utf-8') + if prefix == 'control': + return read_control(f) + return f.read() def get(self, key, default=None): if key in self._cache: |