diff options
author | Ville Skyttä <ville.skytta@iki.fi> | 2016-07-26 23:33:52 +0300 |
---|---|---|
committer | Ville Skyttä <ville.skytta@iki.fi> | 2016-07-27 08:42:14 +0300 |
commit | 8fe8312872898fe970f3117cf46c7ed202e17482 (patch) | |
tree | 07f4a5881a962b1cfe3d6d3ab07e46c4cc2a4d78 /babel | |
parent | 2b37db836f0a7bc253fd2e4a8dd5437aa6dee44e (diff) | |
download | babel-8fe8312872898fe970f3117cf46c7ed202e17482.tar.gz |
Abort catalog update earlier if there are no message catalogs
Diffstat (limited to 'babel')
-rw-r--r-- | babel/messages/frontend.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/babel/messages/frontend.py b/babel/messages/frontend.py index 5a1c741..3c94bf3 100644 --- a/babel/messages/frontend.py +++ b/babel/messages/frontend.py @@ -690,6 +690,9 @@ class update_catalog(Command): else: po_files.append((self.locale, self.output_file)) + if not po_files: + raise DistutilsOptionError('no message catalogs found') + domain = self.domain if not domain: domain = os.path.splitext(os.path.basename(self.input_file))[0] @@ -697,9 +700,6 @@ class update_catalog(Command): with open(self.input_file, 'rb') as infile: template = read_po(infile) - if not po_files: - raise DistutilsOptionError('no message catalogs found') - for locale, filename in po_files: self.log.info('updating catalog %s based on %s', filename, self.input_file) with open(filename, 'rb') as infile: |