[tor-commits] [nyx/master] Graph panel stacktrace due to float width

atagar at torproject.org atagar at torproject.org
Sun Aug 28 18:29:22 UTC 2016


commit 10c791fc665ae0f640ccbb97182aacd16071b24d
Author: Damian Johnson <atagar at torproject.org>
Date:   Sun Aug 28 10:32:50 2016 -0700

    Graph panel stacktrace due to float width
    
    Ewww I suspect we're gonna be stumbling on these for a while. This one
    manifests as...
    
      TypeError: slice indices must be integers or None or have an __index__ method
---
 nyx/panel/graph.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/nyx/panel/graph.py b/nyx/panel/graph.py
index 250c0e6..70b8b60 100644
--- a/nyx/panel/graph.py
+++ b/nyx/panel/graph.py
@@ -567,7 +567,7 @@ class GraphPanel(nyx.panel.Panel):
 
     stat = type(stat)(stat)  # clone the GraphCategory
     subgraph_height = self._graph_height + 2  # graph rows + header + x-axis label
-    subgraph_width = min(subwindow.width / 2, CONFIG['features.graph.max_width'])
+    subgraph_width = min(subwindow.width // 2, CONFIG['features.graph.max_width'])
     interval, bounds_type = self._update_interval, self._bounds_type
 
     subwindow.addstr(0, 0, stat.title(subwindow.width), HIGHLIGHT)





More information about the tor-commits mailing list