merge in Andy's change that got a bit lost in the py33 branch grafting py33
authorrobin
Tue, 30 Jul 2013 17:09:18 +0100
branchpy33
changeset 3751 1809185f0a36
parent 3750 63d5d0c8665e (current diff)
parent 3741 0cadc486be4a (diff)
child 3752 b26975887acc
merge in Andy's change that got a bit lost in the py33 branch grafting
--- a/src/reportlab/__init__.py	Mon Jul 29 13:36:20 2013 +0100
+++ b/src/reportlab/__init__.py	Tue Jul 30 17:09:18 2013 +0100
@@ -7,8 +7,13 @@
 
 import sys
 
-if sys.version_info[0:2] < (2, 5):
-    warning = """The trunk of reportlab currently requires Python 2.5 or higher.
+if sys.version_info[0:2] < (2, 7):
+    warning = """The trunk of reportlab currently requires Python 2.7 or higher.
+
+    This is being done to let us move forwards with 2.7/3.x compatibility
+    with the minimum of baggage.
+    
+    ReportLab 2.7 was the last packaged version to suppo0rt Python 2.5 and 2.6.
 
     Python 2.3 users may still use ReportLab 2.4 or any other bugfixes
     derived from it, and Python 2.4 users may use ReportLab 2.5.  
--- a/src/reportlab/lib/utils.py	Mon Jul 29 13:36:20 2013 +0100
+++ b/src/reportlab/lib/utils.py	Tue Jul 30 17:09:18 2013 +0100
@@ -656,7 +656,10 @@
                     elif mode not in ('L','RGB','CMYK'):
                         im = im.convert('RGB')
                         self.mode = 'RGB'
-                    self._data = im.tostring()
+                    if hasattr(im, 'tobytes'):  #make pillow and PIL both happy, for now
+                        self._data = im.tobytes()
+                    else:
+                        self._data = im.tostring()
             return self._data
         except:
             annotateException('\nidentity=%s'%self.identity())