Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
51ca8043
Commit
51ca8043
authored
Aug 14, 2016
by
Hanno Schlichting
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Start using six and canonicalize version_info check.
parent
3f9d9434
Changes
22
Show whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
46 additions
and
37 deletions
+46
-37
setup.py
setup.py
+1
-0
src/App/Extensions.py
src/App/Extensions.py
+3
-1
src/OFS/Image.py
src/OFS/Image.py
+1
-1
src/OFS/SimpleItem.py
src/OFS/SimpleItem.py
+3
-1
src/OFS/Uninstalled.py
src/OFS/Uninstalled.py
+3
-2
src/Products/Five/fiveconfigure.py
src/Products/Five/fiveconfigure.py
+1
-1
src/Products/PageTemplates/Expressions.py
src/Products/PageTemplates/Expressions.py
+1
-1
src/Products/PageTemplates/ZRPythonExpr.py
src/Products/PageTemplates/ZRPythonExpr.py
+1
-1
src/Products/PageTemplates/ZopePageTemplate.py
src/Products/PageTemplates/ZopePageTemplate.py
+1
-1
src/Products/PageTemplates/tests/testExpressions.py
src/Products/PageTemplates/tests/testExpressions.py
+1
-1
src/Products/PageTemplates/tests/testHTMLTests.py
src/Products/PageTemplates/tests/testHTMLTests.py
+1
-1
src/Products/PageTemplates/tests/testZopePageTemplate.py
src/Products/PageTemplates/tests/testZopePageTemplate.py
+1
-1
src/Products/PageTemplates/unicodeconflictresolver.py
src/Products/PageTemplates/unicodeconflictresolver.py
+1
-1
src/Products/PageTemplates/utils.py
src/Products/PageTemplates/utils.py
+1
-1
src/Shared/DC/Scripts/Bindings.py
src/Shared/DC/Scripts/Bindings.py
+4
-3
src/Testing/ZopeTestCase/ZopeLite.py
src/Testing/ZopeTestCase/ZopeLite.py
+4
-1
src/ZPublisher/HTTPRequest.py
src/ZPublisher/HTTPRequest.py
+1
-1
src/ZPublisher/Publish.py
src/ZPublisher/Publish.py
+5
-5
src/ZPublisher/tests/testBeforeTraverse.py
src/ZPublisher/tests/testBeforeTraverse.py
+2
-1
src/ZPublisher/tests/test_xmlrpc.py
src/ZPublisher/tests/test_xmlrpc.py
+2
-6
src/Zope2/App/startup.py
src/Zope2/App/startup.py
+7
-5
src/Zope2/utilities/mkwsgiinstance.py
src/Zope2/utilities/mkwsgiinstance.py
+1
-1
No files found.
setup.py
View file @
51ca8043
...
@@ -64,6 +64,7 @@ setup(
...
@@ -64,6 +64,7 @@ setup(
'five.globalrequest'
,
'five.globalrequest'
,
'repoze.retry'
,
'repoze.retry'
,
'setuptools'
,
'setuptools'
,
'six'
,
'transaction'
,
'transaction'
,
'waitress'
,
'waitress'
,
'zExceptions >= 3.2'
,
'zExceptions >= 3.2'
,
...
...
src/App/Extensions.py
View file @
51ca8043
...
@@ -17,6 +17,8 @@ Extensions currently include external methods.
...
@@ -17,6 +17,8 @@ Extensions currently include external methods.
import
imp
import
imp
import
os
import
os
from
six
import
exec_
import
Products
import
Products
from
zExceptions
import
NotFound
from
zExceptions
import
NotFound
...
@@ -184,7 +186,7 @@ def getObject(module, name, reload=0,
...
@@ -184,7 +186,7 @@ def getObject(module, name, reload=0,
raise
NotFound
(
"The specified module, '%s', "
raise
NotFound
(
"The specified module, '%s', "
"couldn't be opened."
%
module
)
"couldn't be opened."
%
module
)
module_dict
=
{}
module_dict
=
{}
exec
execsrc
in
module_dict
exec
_
(
execsrc
,
module_dict
)
if
old
is
not
None
:
if
old
is
not
None
:
# XXX Accretive??
# XXX Accretive??
...
...
src/OFS/Image.py
View file @
51ca8043
...
@@ -48,7 +48,7 @@ from zope.event import notify
...
@@ -48,7 +48,7 @@ from zope.event import notify
from
zope.lifecycleevent
import
ObjectModifiedEvent
from
zope.lifecycleevent
import
ObjectModifiedEvent
from
zope.lifecycleevent
import
ObjectCreatedEvent
from
zope.lifecycleevent
import
ObjectCreatedEvent
if
sys
.
version_info
>=
(
3
,
0
):
if
sys
.
version_info
>=
(
3
,
):
unicode
=
str
unicode
=
str
manage_addFileForm
=
DTMLFile
(
manage_addFileForm
=
DTMLFile
(
...
...
src/OFS/SimpleItem.py
View file @
51ca8043
...
@@ -24,6 +24,8 @@ import re
...
@@ -24,6 +24,8 @@ import re
import
sys
import
sys
import
time
import
time
from
six
import
reraise
from
AccessControl.class_init
import
InitializeClass
from
AccessControl.class_init
import
InitializeClass
from
AccessControl.SecurityInfo
import
ClassSecurityInfo
from
AccessControl.SecurityInfo
import
ClassSecurityInfo
from
AccessControl.SecurityManagement
import
getSecurityManager
from
AccessControl.SecurityManagement
import
getSecurityManager
...
@@ -189,7 +191,7 @@ class Item(Base,
...
@@ -189,7 +191,7 @@ class Item(Base,
if
hasattr
(
self
,
'_v_eek'
):
if
hasattr
(
self
,
'_v_eek'
):
# Stop if there is recursion.
# Stop if there is recursion.
r
aise
error_type
,
error_value
,
tb
r
eraise
(
error_type
,
error_value
,
tb
)
self
.
_v_eek
=
1
self
.
_v_eek
=
1
if
hasattr
(
error_type
,
'__name__'
):
if
hasattr
(
error_type
,
'__name__'
):
...
...
src/OFS/Uninstalled.py
View file @
51ca8043
...
@@ -22,6 +22,7 @@ from Acquisition import Explicit
...
@@ -22,6 +22,7 @@ from Acquisition import Explicit
from
App.special_dtml
import
DTMLFile
from
App.special_dtml
import
DTMLFile
from
OFS.SimpleItem
import
Item
from
OFS.SimpleItem
import
Item
from
Persistence
import
Overridable
from
Persistence
import
Overridable
from
six
import
exec_
from
ZODB.broken
import
Broken
as
ZODB_Broken
from
ZODB.broken
import
Broken
as
ZODB_Broken
from
ZODB.broken
import
persistentBroken
from
ZODB.broken
import
persistentBroken
...
@@ -58,8 +59,8 @@ def Broken(self, oid, pair):
...
@@ -58,8 +59,8 @@ def Broken(self, oid, pair):
else
:
else
:
module
,
klassname
=
pair
module
,
klassname
=
pair
d
=
{
'BrokenClass'
:
BrokenClass
}
d
=
{
'BrokenClass'
:
BrokenClass
}
exec
(
"class %s(BrokenClass): ' '; __module__=%r"
%
exec
_
(
"class %s(BrokenClass): ' '; __module__=%r"
%
(
klassname
,
module
))
in
d
(
klassname
,
module
),
d
)
klass
=
broken_klasses
[
pair
]
=
d
[
klassname
]
klass
=
broken_klasses
[
pair
]
=
d
[
klassname
]
module
=
module
.
split
(
'.'
)
module
=
module
.
split
(
'.'
)
if
len
(
module
)
>
2
and
module
[
0
]
==
'Products'
:
if
len
(
module
)
>
2
and
module
[
0
]
==
'Products'
:
...
...
src/Products/Five/fiveconfigure.py
View file @
51ca8043
...
@@ -27,7 +27,7 @@ from zope.publisher.interfaces.browser import IDefaultBrowserLayer
...
@@ -27,7 +27,7 @@ from zope.publisher.interfaces.browser import IDefaultBrowserLayer
from
Products.Five.browser.metaconfigure
import
page
from
Products.Five.browser.metaconfigure
import
page
if
sys
.
version_info
>=
(
3
,
0
):
if
sys
.
version_info
>=
(
3
,
):
basestring
=
str
basestring
=
str
logger
=
logging
.
getLogger
(
'Products.Five'
)
logger
=
logging
.
getLogger
(
'Products.Five'
)
...
...
src/Products/PageTemplates/Expressions.py
View file @
51ca8043
...
@@ -47,7 +47,7 @@ from zope.contentprovider.tales import TALESProviderExpression
...
@@ -47,7 +47,7 @@ from zope.contentprovider.tales import TALESProviderExpression
from
Products.PageTemplates
import
ZRPythonExpr
from
Products.PageTemplates
import
ZRPythonExpr
from
Products.PageTemplates.interfaces
import
IUnicodeEncodingConflictResolver
from
Products.PageTemplates.interfaces
import
IUnicodeEncodingConflictResolver
if
sys
.
version_info
>=
(
3
,
0
):
if
sys
.
version_info
>=
(
3
,
):
basestring
=
str
basestring
=
str
unicode
=
str
unicode
=
str
...
...
src/Products/PageTemplates/ZRPythonExpr.py
View file @
51ca8043
...
@@ -24,7 +24,7 @@ from DocumentTemplate.security import RestrictedDTML
...
@@ -24,7 +24,7 @@ from DocumentTemplate.security import RestrictedDTML
from
RestrictedPython
import
compile_restricted_eval
from
RestrictedPython
import
compile_restricted_eval
from
zope.tales.pythonexpr
import
PythonExpr
from
zope.tales.pythonexpr
import
PythonExpr
if
sys
.
version_info
>=
(
3
,
0
):
if
sys
.
version_info
>=
(
3
,
):
unicode
=
str
unicode
=
str
...
...
src/Products/PageTemplates/ZopePageTemplate.py
View file @
51ca8043
...
@@ -45,7 +45,7 @@ from Products.PageTemplates.utils import encodingFromXMLPreamble
...
@@ -45,7 +45,7 @@ from Products.PageTemplates.utils import encodingFromXMLPreamble
from
Products.PageTemplates.utils
import
charsetFromMetaEquiv
from
Products.PageTemplates.utils
import
charsetFromMetaEquiv
from
Products.PageTemplates.utils
import
convertToUnicode
from
Products.PageTemplates.utils
import
convertToUnicode
if
sys
.
version_info
>=
(
3
,
0
):
if
sys
.
version_info
>=
(
3
,
):
unicode
=
str
unicode
=
str
preferred_encodings
=
[
'utf-8'
,
'iso-8859-15'
]
preferred_encodings
=
[
'utf-8'
,
'iso-8859-15'
]
...
...
src/Products/PageTemplates/tests/testExpressions.py
View file @
51ca8043
...
@@ -5,7 +5,7 @@ import unittest
...
@@ -5,7 +5,7 @@ import unittest
from
zope.component.testing
import
PlacelessSetup
from
zope.component.testing
import
PlacelessSetup
if
sys
.
version_info
>=
(
3
,
0
):
if
sys
.
version_info
>=
(
3
,
):
unicode
=
str
unicode
=
str
...
...
src/Products/PageTemplates/tests/testHTMLTests.py
View file @
51ca8043
...
@@ -27,7 +27,7 @@ from Products.PageTemplates.interfaces import IUnicodeEncodingConflictResolver
...
@@ -27,7 +27,7 @@ from Products.PageTemplates.interfaces import IUnicodeEncodingConflictResolver
from
Products.PageTemplates.unicodeconflictresolver
import
\
from
Products.PageTemplates.unicodeconflictresolver
import
\
DefaultUnicodeEncodingConflictResolver
DefaultUnicodeEncodingConflictResolver
if
sys
.
version_info
>=
(
3
,
0
):
if
sys
.
version_info
>=
(
3
,
):
unicode
=
str
unicode
=
str
...
...
src/Products/PageTemplates/tests/testZopePageTemplate.py
View file @
51ca8043
...
@@ -26,7 +26,7 @@ from Products.PageTemplates.unicodeconflictresolver \
...
@@ -26,7 +26,7 @@ from Products.PageTemplates.unicodeconflictresolver \
import
PreferredCharsetResolver
import
PreferredCharsetResolver
import
Zope2
import
Zope2
if
sys
.
version_info
>=
(
3
,
0
):
if
sys
.
version_info
>=
(
3
,
):
unicode
=
str
unicode
=
str
ascii_str
=
'<html><body>hello world</body></html>'
ascii_str
=
'<html><body>hello world</body></html>'
...
...
src/Products/PageTemplates/unicodeconflictresolver.py
View file @
51ca8043
...
@@ -20,7 +20,7 @@ from Products.PageTemplates.interfaces import IUnicodeEncodingConflictResolver
...
@@ -20,7 +20,7 @@ from Products.PageTemplates.interfaces import IUnicodeEncodingConflictResolver
from
zope.interface
import
implements
from
zope.interface
import
implements
from
zope.i18n.interfaces
import
IUserPreferredCharsets
from
zope.i18n.interfaces
import
IUserPreferredCharsets
if
sys
.
version_info
>=
(
3
,
0
):
if
sys
.
version_info
>=
(
3
,
):
unicode
=
str
unicode
=
str
default_encoding
=
sys
.
getdefaultencoding
()
default_encoding
=
sys
.
getdefaultencoding
()
...
...
src/Products/PageTemplates/utils.py
View file @
51ca8043
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
import
re
import
re
import
sys
import
sys
if
sys
.
version_info
>=
(
3
,
0
):
if
sys
.
version_info
>=
(
3
,
):
unicode
=
str
unicode
=
str
xml_preamble_reg
=
re
.
compile
(
xml_preamble_reg
=
re
.
compile
(
...
...
src/Shared/DC/Scripts/Bindings.py
View file @
51ca8043
...
@@ -14,6 +14,8 @@
...
@@ -14,6 +14,8 @@
import
re
import
re
import
string
import
string
from
six
import
exec_
from
AccessControl.class_init
import
InitializeClass
from
AccessControl.class_init
import
InitializeClass
from
AccessControl.SecurityInfo
import
ClassSecurityInfo
from
AccessControl.SecurityInfo
import
ClassSecurityInfo
from
AccessControl.SecurityManagement
import
getSecurityManager
from
AccessControl.SecurityManagement
import
getSecurityManager
...
@@ -23,7 +25,6 @@ from AccessControl.unauthorized import Unauthorized
...
@@ -23,7 +25,6 @@ from AccessControl.unauthorized import Unauthorized
from
AccessControl.ZopeGuards
import
guarded_getattr
from
AccessControl.ZopeGuards
import
guarded_getattr
from
Acquisition
import
aq_parent
from
Acquisition
import
aq_parent
from
Acquisition
import
aq_inner
from
Acquisition
import
aq_inner
from
Persistence
import
Persistent
defaultBindings
=
{
'name_context'
:
'context'
,
defaultBindings
=
{
'name_context'
:
'context'
,
'name_container'
:
'container'
,
'name_container'
:
'container'
,
...
@@ -207,7 +208,7 @@ class Bindings:
...
@@ -207,7 +208,7 @@ class Bindings:
security
.
declareProtected
(
'Change bindings'
,
'ZBindings_edit'
)
security
.
declareProtected
(
'Change bindings'
,
'ZBindings_edit'
)
def
ZBindings_edit
(
self
,
mapping
):
def
ZBindings_edit
(
self
,
mapping
):
names
=
self
.
_setupBindings
(
mapping
)
self
.
_setupBindings
(
mapping
)
self
.
_prepareBindCode
()
self
.
_prepareBindCode
()
self
.
_editedBindings
()
self
.
_editedBindings
()
...
@@ -356,7 +357,7 @@ class Bindings:
...
@@ -356,7 +357,7 @@ class Bindings:
bound_data
=
{}
bound_data
=
{}
else
:
else
:
bound_data
=
[]
bound_data
=
[]
exec
bindcode
exec
_
(
bindcode
)
bound_data
=
bound_data
[
0
]
bound_data
=
bound_data
[
0
]
return
self
.
_exec
(
bound_data
,
args
,
kw
)
return
self
.
_exec
(
bound_data
,
args
,
kw
)
finally
:
finally
:
...
...
src/Testing/ZopeTestCase/ZopeLite.py
View file @
51ca8043
...
@@ -26,6 +26,9 @@ Typically used as in
...
@@ -26,6 +26,9 @@ Typically used as in
import
os
import
os
import
sys
import
sys
import
time
import
time
from
six
import
exec_
from
Testing.ZopeTestCase
import
layer
from
Testing.ZopeTestCase
import
layer
# Allow code to tell it is run by the test framework
# Allow code to tell it is run by the test framework
...
@@ -54,7 +57,7 @@ def _exec(cmd):
...
@@ -54,7 +57,7 @@ def _exec(cmd):
'''Prints the time it takes to execute 'cmd'.'''
'''Prints the time it takes to execute 'cmd'.'''
if
os
.
environ
.
get
(
'X'
,
None
):
if
os
.
environ
.
get
(
'X'
,
None
):
start
=
time
.
time
()
start
=
time
.
time
()
exec
cmd
exec
_
(
cmd
)
_print
(
'(%.3fs)'
%
(
time
.
time
()
-
start
))
_print
(
'(%.3fs)'
%
(
time
.
time
()
-
start
))
_write
(
'Loading Zope, please stand by '
)
_write
(
'Loading Zope, please stand by '
)
...
...
src/ZPublisher/HTTPRequest.py
View file @
51ca8043
...
@@ -46,7 +46,7 @@ from ZPublisher.BaseRequest import BaseRequest
...
@@ -46,7 +46,7 @@ from ZPublisher.BaseRequest import BaseRequest
from
ZPublisher.BaseRequest
import
quote
from
ZPublisher.BaseRequest
import
quote
from
ZPublisher.Converters
import
get_converter
from
ZPublisher.Converters
import
get_converter
if
sys
.
version_info
>=
(
3
,
0
):
if
sys
.
version_info
>=
(
3
,
):
unicode
=
str
unicode
=
str
# Flags
# Flags
...
...
src/ZPublisher/Publish.py
View file @
51ca8043
...
@@ -18,6 +18,7 @@ from thread import allocate_lock
...
@@ -18,6 +18,7 @@ from thread import allocate_lock
import
transaction
import
transaction
from
urlparse
import
urlparse
from
urlparse
import
urlparse
from
six
import
reraise
from
zExceptions
import
Redirect
from
zExceptions
import
Redirect
from
zope.event
import
notify
from
zope.event
import
notify
from
zope.publisher.interfaces
import
ISkinnable
from
zope.publisher.interfaces
import
ISkinnable
...
@@ -45,7 +46,7 @@ class Retry(Exception):
...
@@ -45,7 +46,7 @@ class Retry(Exception):
if
tb
is
None
:
if
tb
is
None
:
raise
t
(
v
)
raise
t
(
v
)
try
:
try
:
r
aise
t
,
v
,
tb
r
eraise
(
t
,
v
,
tb
)
finally
:
finally
:
tb
=
None
tb
=
None
...
@@ -310,7 +311,7 @@ def publish_module_standard(
...
@@ -310,7 +311,7 @@ def publish_module_standard(
request
.
response
.
_requestShutdown
(
code
)
request
.
response
.
_requestShutdown
(
code
)
try
:
try
:
r
aise
must_die
[
0
],
must_die
[
1
],
must_die
[
2
]
r
eraise
(
must_die
[
0
],
must_die
[
1
],
must_die
[
2
])
finally
:
finally
:
must_die
=
None
must_die
=
None
...
@@ -378,10 +379,9 @@ def get_module_info(module_name, modules={},
...
@@ -378,10 +379,9 @@ def get_module_info(module_name, modules={},
modules
[
module_name
]
=
modules
[
module_name
+
'.cgi'
]
=
info
modules
[
module_name
]
=
modules
[
module_name
+
'.cgi'
]
=
info
return
info
return
info
except
:
except
Exception
:
t
,
v
,
tb
=
sys
.
exc_info
()
t
,
v
,
tb
=
sys
.
exc_info
()
v
=
str
(
v
)
reraise
(
t
,
str
(
v
),
tb
)
raise
ImportError
,
(
t
,
v
),
tb
finally
:
finally
:
tb
=
None
tb
=
None
release
()
release
()
...
...
src/ZPublisher/tests/testBeforeTraverse.py
View file @
51ca8043
...
@@ -119,7 +119,8 @@ def testBeforeTraverse(self):
...
@@ -119,7 +119,8 @@ def testBeforeTraverse(self):
Unregister the borken hook:
Unregister the borken hook:
>>> _ = BeforeTraverse.unregisterBeforeTraverse(container, 'broken_callable')
>>> _ = BeforeTraverse.unregisterBeforeTraverse(
... container, 'broken_callable')
The list of 'before traverse' hooks is empty:
The list of 'before traverse' hooks is empty:
...
...
src/ZPublisher/tests/test_xmlrpc.py
View file @
51ca8043
...
@@ -188,7 +188,6 @@ class XMLRPCResponseTests(unittest.TestCase):
...
@@ -188,7 +188,6 @@ class XMLRPCResponseTests(unittest.TestCase):
def
test_functionattribute
(
self
):
def
test_functionattribute
(
self
):
# Cannot marshal functions or methods, obviously
# Cannot marshal functions or methods, obviously
import
sys
import
xmlrpclib
import
xmlrpclib
def
foo
():
def
foo
():
...
@@ -198,9 +197,6 @@ class XMLRPCResponseTests(unittest.TestCase):
...
@@ -198,9 +197,6 @@ class XMLRPCResponseTests(unittest.TestCase):
faux
=
FauxResponse
()
faux
=
FauxResponse
()
response
=
self
.
_makeOne
(
faux
)
response
=
self
.
_makeOne
(
faux
)
response
.
setBody
(
body
)
response
.
setBody
(
body
)
if
sys
.
version_info
<
(
2
,
6
):
self
.
assertRaises
(
xmlrpclib
.
Fault
,
xmlrpclib
.
loads
,
faux
.
_body
)
else
:
func
=
xmlrpclib
.
loads
(
faux
.
_body
)
func
=
xmlrpclib
.
loads
(
faux
.
_body
)
self
.
assertEqual
(
func
,
(({
'public'
:
{}},),
None
))
self
.
assertEqual
(
func
,
(({
'public'
:
{}},),
None
))
...
...
src/Zope2/App/startup.py
View file @
51ca8043
...
@@ -18,6 +18,8 @@ import logging
...
@@ -18,6 +18,8 @@ import logging
import
sys
import
sys
from
time
import
asctime
from
time
import
asctime
from
six
import
reraise
import
AccessControl.User
import
AccessControl.User
import
App.ZApplication
import
App.ZApplication
import
ExtensionClass
import
ExtensionClass
...
@@ -196,7 +198,7 @@ class ZPublisherExceptionHook:
...
@@ -196,7 +198,7 @@ class ZPublisherExceptionHook:
def
__call__
(
self
,
published
,
REQUEST
,
t
,
v
,
traceback
):
def
__call__
(
self
,
published
,
REQUEST
,
t
,
v
,
traceback
):
try
:
try
:
if
t
is
SystemExit
or
issubclass
(
t
,
Redirect
):
if
t
is
SystemExit
or
issubclass
(
t
,
Redirect
):
r
aise
t
,
v
,
traceback
r
eraise
(
t
,
v
,
traceback
)
if
issubclass
(
t
,
ConflictError
):
if
issubclass
(
t
,
ConflictError
):
self
.
logConflicts
(
v
,
REQUEST
)
self
.
logConflicts
(
v
,
REQUEST
)
...
@@ -227,7 +229,7 @@ class ZPublisherExceptionHook:
...
@@ -227,7 +229,7 @@ class ZPublisherExceptionHook:
if
(
REQUEST
is
None
or
if
(
REQUEST
is
None
or
(
getattr
(
REQUEST
.
get
(
'RESPONSE'
,
None
),
(
getattr
(
REQUEST
.
get
(
'RESPONSE'
,
None
),
'_error_format'
,
''
)
!=
'text/html'
)):
'_error_format'
,
''
)
!=
'text/html'
)):
r
aise
t
,
v
,
traceback
r
eraise
(
t
,
v
,
traceback
)
# Lookup a view for the exception and render it, then
# Lookup a view for the exception and render it, then
# raise the rendered value as the exception value
# raise the rendered value as the exception value
...
@@ -247,7 +249,7 @@ class ZPublisherExceptionHook:
...
@@ -247,7 +249,7 @@ class ZPublisherExceptionHook:
# correctly. We can't do that with all exceptions
# correctly. We can't do that with all exceptions
# because some don't work with the rendered v as
# because some don't work with the rendered v as
# argument.
# argument.
r
aise
t
,
v
,
traceback
r
eraise
(
t
,
v
,
traceback
)
response
=
REQUEST
.
RESPONSE
response
=
REQUEST
.
RESPONSE
response
.
setStatus
(
t
)
response
.
setStatus
(
t
)
response
.
setBody
(
v
)
response
.
setBody
(
v
)
...
@@ -265,7 +267,7 @@ class ZPublisherExceptionHook:
...
@@ -265,7 +267,7 @@ class ZPublisherExceptionHook:
if
f
is
None
:
if
f
is
None
:
published
=
aq_parent
(
published
)
published
=
aq_parent
(
published
)
if
published
is
None
:
if
published
is
None
:
r
aise
t
,
v
,
traceback
r
eraise
(
t
,
v
,
traceback
)
else
:
else
:
break
break
...
@@ -293,7 +295,7 @@ class ZPublisherExceptionHook:
...
@@ -293,7 +295,7 @@ class ZPublisherExceptionHook:
# correctly. We can't do that with all exceptions
# correctly. We can't do that with all exceptions
# because some don't work with the rendered v as
# because some don't work with the rendered v as
# argument.
# argument.
r
aise
t
,
v
,
traceback
r
eraise
(
t
,
v
,
traceback
)
response
=
REQUEST
.
RESPONSE
response
=
REQUEST
.
RESPONSE
response
.
setStatus
(
t
)
response
.
setStatus
(
t
)
response
.
setBody
(
v
)
response
.
setBody
(
v
)
...
...
src/Zope2/utilities/mkwsgiinstance.py
View file @
51ca8043
...
@@ -31,7 +31,7 @@ import os
...
@@ -31,7 +31,7 @@ import os
import
sys
import
sys
import
copyzopeskel
import
copyzopeskel
if
sys
.
version_info
>
(
3
,
0
):
if
sys
.
version_info
>
(
3
,
):
raw_input
=
input
raw_input
=
input
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment