Browse Source

Fixed TypeError on Python 3

pull/8/head
Jason R. Coombs 14 years ago
parent
commit
153ddd14ce
  1. 2
      setup.py
  2. 7
      svg/charts/plot.py

2
setup.py

@ -33,7 +33,7 @@ setup_params = dict(
namespace_packages=['svg'],
include_package_data = True,
install_requires=[
'cssutils>=0.9.6b3',
'cssutils>=0.9.8a3',
'lxml>=2.0',
] + dateutil_req,
license = "MIT",

7
svg/charts/plot.py

@ -1,4 +1,7 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"plot.py"
import sys
from itertools import izip, count, chain
from lxml import etree
@ -173,6 +176,8 @@ class Plot(Graph):
# above is same as
#max_value = max(map(lambda set: max(set['data'][data_index]), self.data))
spec_max = getattr(self, 'max_%s_value' % axis)
# Python 3 doesn't allow comparing None to int, so use -∞
if spec_max is None: spec_max = float('-Inf')
max_value = max(max_value, spec_max)
return max_value

Loading…
Cancel
Save