Skip to content

Commit

Permalink
Unify Python 2 and Python 3 output
Browse files Browse the repository at this point in the history
This is subtle: Python 2 treats / as integer division (i.e. rounds
down).  Python 3 treats it as float division always.  This produces
subtly-different text positions in some cases.  It's hard to see
visually, but PDF comparison tools notice.

By using a __future__ import I avoid future problems like this creeping
back in.

If rounding down is actually desired somewhere, I can use the //
operator.
  • Loading branch information
mgedmin committed Dec 5, 2014
1 parent 053da4c commit 2cc71ac
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions mgp2pdf.py
Expand Up @@ -3,6 +3,8 @@
A quick-and-dirty MagicPoint to PDF converter.
"""

from __future__ import division

import os
import re
import sys
Expand Down

0 comments on commit 2cc71ac

Please sign in to comment.