aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/interpreter.py
diff options
context:
space:
mode:
authorElliott Sales de Andrade <quantum.analyst@gmail.com>2016-09-02 17:00:58 -0400
committerJussi Pakkanen <jpakkane@gmail.com>2016-09-03 00:00:58 +0300
commita7cf241334e3a76317b843b83991d7b1d50118b9 (patch)
tree0a2760f6f8d2339245d6cfae248e31c01493b8e4 /mesonbuild/interpreter.py
parent84995b2993a875496827b28293f228902038dcd7 (diff)
downloadmeson-a7cf241334e3a76317b843b83991d7b1d50118b9.zip
meson-a7cf241334e3a76317b843b83991d7b1d50118b9.tar.gz
meson-a7cf241334e3a76317b843b83991d7b1d50118b9.tar.bz2
Fix validation of man page extension. (#749)
If the extension does not exist or is not a number, the error message is not raised because the assumptions cause a different exception.
Diffstat (limited to 'mesonbuild/interpreter.py')
-rw-r--r--mesonbuild/interpreter.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py
index abbeaf7..ad381b6 100644
--- a/mesonbuild/interpreter.py
+++ b/mesonbuild/interpreter.py
@@ -454,7 +454,10 @@ class Man(InterpreterObject):
def validate_sources(self):
for s in self.sources:
- num = int(s.split('.')[-1])
+ try:
+ num = int(s.split('.')[-1])
+ except (IndexError, ValueError):
+ num = 0
if num < 1 or num > 8:
raise InvalidArguments('Man file must have a file extension of a number between 1 and 8')