@@ -45,17 +45,16 @@ def handle_makemessages(self, **options):
45
45
if mapping_file is None and 'extract_messages' in distribution .command_options :
46
46
opts = distribution .command_options ['extract_messages' ]
47
47
try :
48
- mapping_file = opts . get ( 'mapping_file' , ()) [1 ]
49
- except IndexError :
48
+ mapping_file = opts [ 'mapping_file' ] [1 ]
49
+ except ( IndexError , KeyError ) :
50
50
mapping_file = None
51
51
52
52
for path in locale_paths :
53
53
potfile = os .path .join (path , '%s.pot' % domain )
54
54
if not os .path .exists (potfile ):
55
55
continue
56
56
57
- cmd = ['pybabel' , 'extract' , '-o' ,
58
- os .path .join (path , '%s.pot' % domain )]
57
+ cmd = ['pybabel' , 'extract' , '-o' , potfile ]
59
58
60
59
if mapping_file is not None :
61
60
cmd .extend (['-F' , mapping_file ])
@@ -66,7 +65,7 @@ def handle_makemessages(self, **options):
66
65
67
66
for locale in locales :
68
67
cmd = ['pybabel' , 'update' , '-D' , domain ,
69
- '-i' , os . path . join ( path , '%s.pot' % domain ) ,
68
+ '-i' , potfile ,
70
69
'-d' , path ,
71
70
'-l' , locale ]
72
71
call (cmd )
0 commit comments