def __init__(self):
try:<EOL><INDENT>p = subprocess.Popen(['<STR_LIT>', '<STR_LIT>'],<EOL>stdout=subprocess.PIPE,<EOL>stderr=subprocess.PIPE)<EOL>num_colors = int(p.stdout.read())<EOL><DEDENT>except (OSError, ValueError):<EOL><INDENT>num_colors = <NUM_LIT:1><EOL><DEDENT>self.has_colors = False<EOL>if num_colors > <NUM_LIT:1>:<EOL><INDENT>self.has_colors = True<EOL><DEDENT>self.enable_colors()<EOL>self.COLORS = self.enumerate_colors()<EOL>
Checks if the shell supports colors