[Zope-Checkins] SVN: Zope/trunk/ Removed fallback code for old Python versions from `ZServer.FTPServer.zope_ftp_channel.push`.

Hanno Schlichting hannosch at hannosch.eu
Fri Jul 9 14:20:56 EDT 2010


Log message for revision 114398:
  Removed fallback code for old Python versions from `ZServer.FTPServer.zope_ftp_channel.push`.
  

Changed:
  U   Zope/trunk/doc/CHANGES.rst
  U   Zope/trunk/src/ZServer/FTPServer.py

-=-
Modified: Zope/trunk/doc/CHANGES.rst
===================================================================
--- Zope/trunk/doc/CHANGES.rst	2010-07-09 18:18:03 UTC (rev 114397)
+++ Zope/trunk/doc/CHANGES.rst	2010-07-09 18:20:55 UTC (rev 114398)
@@ -22,6 +22,9 @@
 Restructuring
 +++++++++++++
 
+- Removed fallback code for old Python versions from
+  `ZServer.FTPServer.zope_ftp_channel.push`.
+
 - Removed fallback code for old `ZCatalog.catalog_object` function signatures
   from `Products.ZCatalog.ZCatalog.reindexIndex`.
 

Modified: Zope/trunk/src/ZServer/FTPServer.py
===================================================================
--- Zope/trunk/src/ZServer/FTPServer.py	2010-07-09 18:18:03 UTC (rev 114397)
+++ Zope/trunk/src/ZServer/FTPServer.py	2010-07-09 18:20:55 UTC (rev 114398)
@@ -64,7 +64,6 @@
 
 """
 
-import sys
 from PubCore import handle
 from medusa.ftp_server import ftp_channel, ftp_server, recv_channel
 import asyncore, asynchat
@@ -82,9 +81,7 @@
 import stat
 import time
 
-py26_or_later = sys.version_info >= (2,6)
 
-
 class zope_ftp_channel(ftp_channel):
     "Passes its commands to Zope, not a filesystem"
 
@@ -113,18 +110,13 @@
         # note, that strings are not wrapped in
         # producers by default
 
-        # LP #418454
-        if py26_or_later:
-            # Python 2.6 or later
-            sabs = self.ac_out_buffer_size
-            if len(data) > sabs:
-                for i in xrange(0, len(data), sabs):
-                    self.producer_fifo.append(data[i:i+sabs])
-            else:
-                self.producer_fifo.append(data)
+        # LP #418454, Python 2.6 or later
+        sabs = self.ac_out_buffer_size
+        if len(data) > sabs:
+            for i in xrange(0, len(data), sabs):
+                self.producer_fifo.append(data[i:i+sabs])
         else:
-            # pre-Python 2.6
-            self.producer_fifo.push(data)
+            self.producer_fifo.append(data)
         if send: 
             self.initiate_send()
 



More information about the Zope-Checkins mailing list