From ea1c29ca2e2322653b96c28f4912eb5765f99921 Mon Sep 17 00:00:00 2001 From: Ian Cordasco Date: Mon, 25 Feb 2013 22:50:57 -0500 Subject: [PATCH] Fixes #86 on bitbucket Create hgrc if it doesn't exist. --- flake8/hooks.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/flake8/hooks.py b/flake8/hooks.py index 4d5eb3b..4065d89 100644 --- a/flake8/hooks.py +++ b/flake8/hooks.py @@ -109,6 +109,10 @@ if __name__ == '__main__': def _install_hg_hook(path): + if not os.path.isfile(path): + # Make the file so we can avoid IOError's + open(path, 'w+').close() + c = ConfigParser() c.readfp(open(path, 'r')) if not c.has_section('hooks'):