diff --git a/config/printconfigsetting.py b/config/printconfigsetting.py index bdd6f2a2bc6..ef900a6c05b 100644 --- a/config/printconfigsetting.py +++ b/config/printconfigsetting.py @@ -2,7 +2,10 @@ # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. -import configobj, sys +import configobj +import sys +import re +from StringIO import StringIO try: (file, section, key) = sys.argv[1:] @@ -10,7 +13,10 @@ except ValueError: print "Usage: printconfigsetting.py
" sys.exit(1) -c = configobj.ConfigObj(file) +with open(file) as fh: + content = re.sub('^\s*;', '#', fh.read(), flags=re.M) + +c = configobj.ConfigObj(StringIO(content)) try: s = c[section]