def check_arg_types(funcname, *args):
hasstr = hasbytes = False<EOL>for arg in args:<EOL><INDENT>if isinstance(arg, str):<EOL><INDENT>hasstr = True<EOL><DEDENT>elif isinstance(arg, bytes):<EOL><INDENT>hasbytes = True<EOL><DEDENT>else:<EOL><INDENT>raise TypeError('<STR_LIT>'<EOL>.format(funcname, arg.__class__.__name__))<EOL><DEDENT><DEDENT>if hasstr and hasbytes:<EOL><INDENT>raise TypeError("<STR_LIT>")<EOL><DEDENT>
Raise TypeError if not all items of `args` are same string type.