[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [nyx/master] Drop 'unknown terminal' check



commit beead811f9cd98337a4510cdcbd5e7d6ccbdd9b4
Author: Damian Johnson <atagar@xxxxxxxxxxxxxx>
Date:   Sat Sep 2 18:16:37 2017 -0700

    Drop 'unknown terminal' check
    
    Just ran into this due to a regression on my part. The message doesn't give
    enough information to be useful and if it masks our own issues that's clearly a
    no-go.
---
 nyx/starter.py | 10 ----------
 nyx/tracker.py |  2 +-
 2 files changed, 1 insertion(+), 11 deletions(-)

diff --git a/nyx/starter.py b/nyx/starter.py
index 6aa98b7..077ca36 100644
--- a/nyx/starter.py
+++ b/nyx/starter.py
@@ -36,11 +36,6 @@ Nyx Configuration ({nyxrc_path}):
 --------------------------------------------------------------------------------
 """.strip()
 
-UNKNOWN_TERM = """\
-Unknown $TERM: (%s)
-Either update your terminfo database or run nyx using "TERM=xterm nyx".
-"""
-
 
 @uses_settings
 def main(config):
@@ -102,11 +97,6 @@ def main(config):
 
   try:
     nyx.curses.start(nyx.draw_loop, acs_support = config.get('acs_support', True), transparent_background = True, cursor = False)
-  except UnboundLocalError as exc:
-    if os.environ['TERM'] != 'xterm':
-      print(UNKNOWN_TERM % os.environ['TERM'])
-    else:
-      raise exc
   except KeyboardInterrupt:
     pass  # skip printing a stack trace
   finally:
diff --git a/nyx/tracker.py b/nyx/tracker.py
index 7a16817..8630529 100644
--- a/nyx/tracker.py
+++ b/nyx/tracker.py
@@ -818,12 +818,12 @@ class ConsensusTracker(object):
     # consensus available).
 
     cache_age = time.time() - nyx.cache().relays_updated_at()
+    controller = tor_controller()
 
     if cache_age < 3600:
       stem.util.log.info('Cached is only %i seconds old, no need to refresh it.' % cache_age)
     else:
       start_time = time.time()
-      controller = tor_controller()
       ns_response = controller.get_info('ns/all', None)
 
       if ns_response:



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits