Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: cms/sources.py

Issue 29972568: Issue 5828 - Additional paths require settings.ini (Closed) Base URL: https://hg.adblockplus.org/cms/
Patch Set: Created Jan. 3, 2019, 11:43 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tests/test_additional_paths.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cms/sources.py
===================================================================
--- a/cms/sources.py
+++ b/cms/sources.py
@@ -70,10 +70,13 @@
return locale, '/' + page
def read_config(self):
- configdata = self.read_file('settings.ini')[0]
- config = ConfigParser.SafeConfigParser()
- config.readfp(StringIO(configdata))
- return config
+ try:
+ configdata = self.read_file('settings.ini')[0]
+ config = ConfigParser.SafeConfigParser()
+ config.readfp(StringIO(configdata))
+ return config
+ except IOError:
+ return ConfigParser.SafeConfigParser()
Vasily Kuznetsov 2019/01/04 18:46:03 This will do the trick, however, I'm worried that
rhowell 2019/01/08 00:19:25 Yeah, this seems clearer. Done.
def exec_file(self, filename):
source, filename = self.read_file(filename)
« no previous file with comments | « no previous file | tests/test_additional_paths.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld