"""
This is not needed to use vex.
It just lets us provide a convenient mechanism for people
with popular shells to set up autocompletion.
"""
import sys
import os

_HERE = os.path.dirname(os.path.abspath(__file__))

_SHELLS = {
}


def emit_shell_config_for(shell, vexrc, environ):
    function = _SHELLS.get(shell)
    if function:
        out = sys.stdout.buffer
        function(out, vexrc, environ)

@@ -335,16 +335,112 @@
         
+if hasattr(sys.stdout, 'buffer'):%0A            out = sys.stdout.buffer%0A        else:%0A            
 out = sy
@@ -439,39 +439,32 @@
 out = sys.stdout
-.buffer
 %0A        functio

handle 2.7's lack of sys.stdout.buffer in emit_shell_config