def _warn_if_activetcl_or_teapot_installed(tcl_root, tcltree):
 from PyInstaller.lib.macholib import util
 if util.in_system_path(tcl_root):
  return
 try:
  init_resource = [r[1] for r in tcltree if r[1].endswith('init.tcl')][0]
 except IndexError:
  return
 mentions_activetcl = False
 mentions_teapot = False
 with open(init_resource, 'r') as init_file:
  for line in init_file.readlines():
   line = line.strip().lower()
   if line.startswith('#'):
    continue
   if ('activetcl' in line):
    mentions_activetcl = True
   if ('teapot' in line):
    mentions_teapot = True
   if (mentions_activetcl and mentions_teapot):
    break
 if (mentions_activetcl and mentions_teapot):
  logger.warning(('\nYou appear to be using an ActiveTcl build of Tcl/Tk, which PyInstaller has\ndifficulty freezing. To fix this, comment out all references to "teapot" in:\n\n     %s\n\nSee https://github.com/pyinstaller/pyinstaller/issues/621 for more information.\n            ' % init_resource))

def _warn_if_activetcl_or_teapot_installed ( tcl_root , tcltree ) : from PyInstaller . lib . macholib import util if util . in_system_path ( tcl_root ) : return try : init_resource = [ r [ 1 ] for r in tcltree if r [ 1 ] . endswith ( 'init.tcl' ) ] [ 0 ] except IndexError : return mentions_activetcl = False mentions_teapot = False with open ( init_resource , 'r' ) as init_file : for line in init_file . readlines ( ) : line = line . strip ( ) . lower ( ) if line . startswith ( '#' ) : continue if ( 'activetcl' in line ) : mentions_activetcl = True if ( 'teapot' in line ) : mentions_teapot = True if ( mentions_activetcl and mentions_teapot ) : break if ( mentions_activetcl and mentions_teapot ) : logger . warning ( ( '\nYou appear to be using an ActiveTcl build of Tcl/Tk, which PyInstaller has\ndifficulty freezing. To fix this, comment out all references to "teapot" in:\n\n     %s\n\nSee https://github.com/pyinstaller/pyinstaller/issues/621 for more information.\n            ' % init_resource ) )
if the current tcl installation is a teapot-distributed version of activetcl *and* the current platform is os x .