Skip to content

Commit

Permalink
Avoid crashing with python3 because of non-integer array slice.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeyklyukin committed Dec 29, 2015
1 parent 10b1443 commit add65ee
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pg_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ def _trim_text_middle(val, maxw):
This kind of trimming seems to be better than tail trimming for user and database names.
"""

half = (maxw - 2) / 2
half = int((maxw - 2) / 2)

This comment has been minimized.

Copy link
@a1exsh

a1exsh Dec 30, 2015

Member

I thought I've had enough with python3 vs. python2... but it never stops surprising me.

return val[:half] + '..' + val[-half:]

def _do_refresh(self, new_rows):
Expand Down

0 comments on commit add65ee

Please sign in to comment.