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,7 +682,7 @@ class TestCalendar(ERP5ReportTestCase):
Test getCapacityAvailability
"""
if not run: return
raise "NotImplementedYet"
raise NotImplemented
# Test that calendar group increase time availability
sequence_list = SequenceList()
......
......@@ -13,6 +13,7 @@
##############################################################################
from OFS import Moniker
from zExceptions import BadRequest
from AccessControl import ClassSecurityInfo, getSecurityManager
from AccessControl.Permission import Permission
from OFS.ObjectManager import ObjectManager
......@@ -225,7 +226,7 @@ class CopyContainer:
id = ob.id
v=container._getOb(id, self)
if v is self:
raise 'BadRequest', '%s does not exist' % ids[-1]
raise BadRequest('%s does not exist' % ids[-1])
container._delObject(id)
del uids[-1]
if REQUEST is not None:
......
......@@ -107,7 +107,7 @@ def Base_asXML(object, root=None):
block = SubElement(sub_object, 'block_data')
block.text = data_encoded
else:
raise "XMLExportImport failed, the data is undefined"
raise ValueError("XMLExportImport failed, the data is undefined")
elif prop_type in ('lines', 'tokens',):
# Use CDATA node to not be taken into account by erp5diff
value = [word.decode('utf-8').encode('ascii','xmlcharrefreplace')\
......
......@@ -849,17 +849,16 @@ class ERP5TypeTestCase(backportUnittest.TestCase, PortalTestCase):
update_business_templates = os.environ.get('update_business_templates') is not 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_list = []
from DateTime import DateTime
for url, bt_title in business_template_list:
# if the bt is not found, an error is raised
if not portal.portal_templates.assertBtPathExists(url):
missing_bt_list.append(bt_title)
if len(missing_bt_list):
raise "Some bt can't be found on your system : %r" % \
missing_bt_list
raise RuntimeError("Some BT can't be found on your system : %s"
% ', '.join(missing_bt_list))
# Add some business templates
for url, bt_title in business_template_list:
......
......@@ -548,7 +548,7 @@ class WizardTool(BaseTool):
server_buffer = server_response.get("server_buffer", None)
if server_buffer is None:
# 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", [])
portal_templates = getToolByName(portal, 'portal_templates')
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