title: How is it possible to use raw_input() in a Python Git hook?
body: <p>I am writing a pre-commit hook for Git that runs pyflakes and checks for tabs and trailing spaces in the modified files (<a href="https://github.com/badzil/miscellaneous/blob/master/pre-commit">code on Github</a>). I would like to make it possible to override the hook by asking for user confirmation as follows:</p>
  
  <pre><code>answer = raw_input('Commit anyway? [N/y] ')
  if answer.strip()[0].lower() == 'y':
      print &gt;&gt; sys.stderr, 'Committing anyway.'
      sys.exit(0)
  else:
      print &gt;&gt; sys.stderr, 'Commit aborted.'
      sys.exit(1)
  </code></pre>
  
  <p>This code produces an error:</p>
  
  <pre><code>Commit anyway? [N/y] Traceback (most recent call last):
    File ".git/hooks/pre-commit", line 59, in ?
      main()
    File ".git/hooks/pre-commit", line 20, in main
      answer = raw_input('Commit anyway? [N/y] ')
  EOFError: EOF when reading a line
  </code></pre>
  
  <p>Is it even possible to use raw_input() or a similar function in Git hooks and if yes, what am I doing wrong?</p>