Commit f4cfa060 authored by Damian Johnson's avatar Damian Johnson
Browse files

Avoid os.putenv calls on FreeBSD

Turns out even when we suppress the exceptions it causes the interpreter to
print to stdout. Lets just avoid these calls entirely on FreeBSD. Dropping the
catch clauses since we were only doing this due to FreeBSD.
parent 68f6f573
Loading
Loading
Loading
Loading
+6 −7
Original line number Diff line number Diff line
@@ -87,15 +87,14 @@ def main(config):
  _use_unicode()
  _set_process_name()

  try:
    os.putenv('LANG', 'C')  # make subcommands (ps, netstat, etc) provide english results
  except OSError:
    pass
  # These os.putenv calls fail on FreeBSD, and even attempting causes python to
  # print the following to stdout...
  #
  #   nyx: environment corrupt; missing value for

  try:
  if not stem.util.system.is_bsd():
    os.putenv('LANG', 'C')  # make subcommands (ps, netstat, etc) provide english results
    os.putenv('ESCDELAY', '0')  # make 'esc' take effect right away
  except OSError:
    pass

  try:
    nyx.curses.start(nyx.draw_loop, acs_support = config.get('acs_support', True), transparent_background = True, cursor = False)