8000 Merge pull request #3838 from jenshnielsen/units_examples_python3 · matplotlib/matplotlib@72c2503 · GitHub
[go: up one dir, main page]

Skip to content

Commit 72c2503

Browse files
committed
Merge pull request #3838 from jenshnielsen/units_examples_python3
Fix units examples under python3
1 parent 95e2346 commit 72c2503

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

examples/units/basic_units.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,11 @@ def __new__(cls, value, unit):
123123
{})
124124
if subcls not in units.registry:
125125
units.registry[subcls] = basicConverter
126-
return object.__new__(subcls, value, unit)
126+
return object.__new__(subcls)
127127
except TypeError:
128128
if cls not in units.registry:
129129
units.registry[cls] = basicConverter
130-
return object.__new__(cls, value, unit)
130+
return object.__new__(cls)
131131

132132
def __init__(self, value, unit):
133133
self.value = value
@@ -311,7 +311,7 @@ def rad_fn(x, pos=None):
311311
elif n == 2:
312312
return r'$\pi$'
313313
elif n % 2 == 0:
314-
return r'$%s\pi$' % (n/2,)
314+
return r'$%s\pi$' % (n//2,)
315315
else:
316316
return r'$%s\pi/2$' % (n,)
317317

0 commit comments

Comments
 (0)
0