python3.2でnoseインストール

インストーラがこける。setup.pyの63行付近以下のように改造。contents引数がstrのときとbytesのときの両方があるみたいだ。

        def wrap_write_script(self, script_name, contents, *arg, **kwarg):
            if type(contents) is bytes:
                bad_text = re.compile(
                    b"\n"
                    b"sys.exit\(\n"
                    b"   load_entry_point\(([^\)]+)\)\(\)\n"
                    b"\)\n")
                good_text = (
                    b"\n"
                    b"if __name__ == '__main__':\n"
                    b"    sys.exit(\n"
                    b"        load_entry_point(\1)()\n"
                    b"    )\n"
                    )
                print(type(bad_text), type(good_text), type(contents))
                contents = bad_text.sub(good_text, contents)
                return self._write_script(script_name, contents, *arg, **kwarg)
            else:
                bad_text = re.compile(
                    "\n"
                    "sys.exit\(\n"
                    "   load_entry_point\(([^\)]+)\)\(\)\n"
                    "\)\n")
                good_text = (
                    "\n"
                    "if __name__ == '__main__':\n"
                    "    sys.exit(\n"
                    "        load_entry_point(\1)()\n"
                    "    )\n"
                    )
                print(type(bad_text), type(good_text), type(contents))
                contents = bad_text.sub(good_text, contents)
                return self._write_script(script_name, contents, *arg, **kwarg)