Skip to content

Commit

Permalink
Merge pull request #3838 from jenshnielsen/units_examples_python3
Browse files Browse the repository at this point in the history
Fix units examples under python3
  • Loading branch information
mdboom committed Oct 20, 2015
1 parent 95e2346 commit 72c2503
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions examples/units/basic_units.py
Expand Up @@ -123,11 +123,11 @@ def __new__(cls, value, unit):
{})
if subcls not in units.registry:
units.registry[subcls] = basicConverter
return object.__new__(subcls, value, unit)
return object.__new__(subcls)
except TypeError:
if cls not in units.registry:
units.registry[cls] = basicConverter
return object.__new__(cls, value, unit)
return object.__new__(cls)

def __init__(self, value, unit):
self.value = value
Expand Down Expand Up @@ -311,7 +311,7 @@ def rad_fn(x, pos=None):
elif n == 2:
return r'$\pi$'
elif n % 2 == 0:
return r'$%s\pi$' % (n/2,)
return r'$%s\pi$' % (n//2,)
else:
return r'$%s\pi/2$' % (n,)

Expand Down

0 comments on commit 72c2503

Please sign in to comment.