Skip to content

Commit

Permalink
Use correct integer division
Browse files Browse the repository at this point in the history
Without this, we get the following on Python 3:

    return '%s%*s' % (markup_fn(text), pad_len, '')
    TypeError: * wants int
  • Loading branch information
myint committed Jun 20, 2014
1 parent e3e838d commit 18b3b85
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cdiff.py
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ def _fit_with_marker_mix(text, base_color, width, pad=False):
# [terminal size minus the line number columns and 3 separating
# spaces
#
width = (terminal_size()[0] - num_width * 2 - 3) / 2
width = (terminal_size()[0] - num_width * 2 - 3) // 2
except Exception:
# If terminal detection failed, set back to default
width = 80
Expand Down

2 comments on commit 18b3b85

@amigrave
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ymattw: sorry about that!

@ymattw
Copy link
Owner

@ymattw ymattw commented on 18b3b85 Jul 3, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@amigrave totally fine! Contribution is always welcome.

Please sign in to comment.