Skip to content

Commit

Permalink
Use the join method
Browse files Browse the repository at this point in the history
  • Loading branch information
ale-rt committed Mar 27, 2018
1 parent 4396480 commit b26887e
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions Products/ExternalEditor/ExternalEditor.py
Expand Up @@ -16,11 +16,6 @@

# Zope External Editor Product by Casey Duncan

try:
from string import join # For Zope 2.3 compatibility
except ImportError:
# Python 3
join = str.join
from Acquisition import aq_inner, aq_base, aq_parent, Implicit
try:
from App.class_init import InitializeClass
Expand Down Expand Up @@ -173,7 +168,7 @@ def index_html(self, REQUEST, RESPONSE, path=None):

# Finish metadata with an empty line.
r.append('')
metadata = join(r, '\n')
metadata = '\n'.join(r)
metadata_len = len(metadata)

# Check if we should send the file's data down the response.
Expand Down Expand Up @@ -240,7 +235,7 @@ def index_html(self, REQUEST, RESPONSE, path=None):
# set the headers ourselves since _write_metadata won't get
# called.
self._set_headers(RESPONSE)
return join((metadata, body), '\n')
return '\n'.join((metadata, body))

def _set_headers(self, RESPONSE):
# Using RESPONSE.setHeader('Pragma', 'no-cache') would be better, but
Expand Down

0 comments on commit b26887e

Please sign in to comment.