Commit 2e932dd6 authored by Julien Muchembled's avatar Julien Muchembled

Replace a few string exceptions (which are not supported anymore since Python 2.6)

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@30506 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 1ff50d0d
...@@ -682,8 +682,8 @@ class TestCalendar(ERP5ReportTestCase): ...@@ -682,8 +682,8 @@ class TestCalendar(ERP5ReportTestCase):
Test getCapacityAvailability Test getCapacityAvailability
""" """
if not run: return if not run: return
raise "NotImplementedYet" raise NotImplemented
# Test that calendar group increase time availability # Test that calendar group increase time availability
sequence_list = SequenceList() sequence_list = SequenceList()
sequence_string = '\ sequence_string = '\
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
############################################################################## ##############################################################################
from OFS import Moniker from OFS import Moniker
from zExceptions import BadRequest
from AccessControl import ClassSecurityInfo, getSecurityManager from AccessControl import ClassSecurityInfo, getSecurityManager
from AccessControl.Permission import Permission from AccessControl.Permission import Permission
from OFS.ObjectManager import ObjectManager from OFS.ObjectManager import ObjectManager
...@@ -225,7 +226,7 @@ class CopyContainer: ...@@ -225,7 +226,7 @@ class CopyContainer:
id = ob.id id = ob.id
v=container._getOb(id, self) v=container._getOb(id, self)
if v is self: if v is self:
raise 'BadRequest', '%s does not exist' % ids[-1] raise BadRequest('%s does not exist' % ids[-1])
container._delObject(id) container._delObject(id)
del uids[-1] del uids[-1]
if REQUEST is not None: if REQUEST is not None:
......
...@@ -106,8 +106,8 @@ def Base_asXML(object, root=None): ...@@ -106,8 +106,8 @@ def Base_asXML(object, root=None):
data_encoded = standard_b64encode(content) data_encoded = standard_b64encode(content)
block = SubElement(sub_object, 'block_data') block = SubElement(sub_object, 'block_data')
block.text = data_encoded block.text = data_encoded
else: else:
raise "XMLExportImport failed, the data is undefined" raise ValueError("XMLExportImport failed, the data is undefined")
elif prop_type in ('lines', 'tokens',): elif prop_type in ('lines', 'tokens',):
# Use CDATA node to not be taken into account by erp5diff # Use CDATA node to not be taken into account by erp5diff
value = [word.decode('utf-8').encode('ascii','xmlcharrefreplace')\ value = [word.decode('utf-8').encode('ascii','xmlcharrefreplace')\
......
...@@ -849,17 +849,16 @@ class ERP5TypeTestCase(backportUnittest.TestCase, PortalTestCase): ...@@ -849,17 +849,16 @@ class ERP5TypeTestCase(backportUnittest.TestCase, PortalTestCase):
update_business_templates = os.environ.get('update_business_templates') is not None update_business_templates = os.environ.get('update_business_templates') is not None
BusinessTemplate_getModifiedObject = aq_base(getattr(portal, 'BusinessTemplate_getModifiedObject', None)) BusinessTemplate_getModifiedObject = aq_base(getattr(portal, 'BusinessTemplate_getModifiedObject', None))
# check that all bt5 exists, this permit to save time in case of # check that all bt5 exist, this permit to save time in case of
# missing bt # missing bt
missing_bt_list = [] missing_bt_list = []
from DateTime import DateTime
for url, bt_title in business_template_list: for url, bt_title in business_template_list:
# if the bt is not found, an error is raised # if the bt is not found, an error is raised
if not portal.portal_templates.assertBtPathExists(url): if not portal.portal_templates.assertBtPathExists(url):
missing_bt_list.append(bt_title) missing_bt_list.append(bt_title)
if len(missing_bt_list): if len(missing_bt_list):
raise "Some bt can't be found on your system : %r" % \ raise RuntimeError("Some BT can't be found on your system : %s"
missing_bt_list % ', '.join(missing_bt_list))
# Add some business templates # Add some business templates
for url, bt_title in business_template_list: for url, bt_title in business_template_list:
......
...@@ -548,7 +548,7 @@ class WizardTool(BaseTool): ...@@ -548,7 +548,7 @@ class WizardTool(BaseTool):
server_buffer = server_response.get("server_buffer", None) server_buffer = server_response.get("server_buffer", None)
if server_buffer is None: if server_buffer is None:
# server doesn't comform protocol which means a possible server error # server doesn't comform protocol which means a possible server error
raise "Witch server configuration error." raise ValueError("Witch server configuration error")
bt5_filenames = server_buffer.get("filenames", []) bt5_filenames = server_buffer.get("filenames", [])
portal_templates = getToolByName(portal, 'portal_templates') portal_templates = getToolByName(portal, 'portal_templates')
counter = 0 counter = 0
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment