Commit 8e346de8 authored by Jason Swails's avatar Jason Swails
Browse files

Fix Python 3 support in unit package.

parent 96f0c0f2
...@@ -77,6 +77,7 @@ import math ...@@ -77,6 +77,7 @@ import math
import copy import copy
from .standard_dimensions import * from .standard_dimensions import *
from .unit import Unit, is_unit, dimensionless from .unit import Unit, is_unit, dimensionless
import sys
class Quantity(object): class Quantity(object):
"""Physical quantity, such as 1.3 meters per second. """Physical quantity, such as 1.3 meters per second.
...@@ -818,6 +819,8 @@ def _is_string(x): ...@@ -818,6 +819,8 @@ def _is_string(x):
except StopIteration: except StopIteration:
return False return False
if sys.version_info >= (3,):
del Quantity.__nonzero__
# run module directly for testing # run module directly for testing
if __name__=='__main__': if __name__=='__main__':
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment