Skip to content

Commit 05eeb87

Browse files
Do not use deprecated form of raising exceptions.
1 parent 6946391 commit 05eeb87

File tree

1 file changed

+4
-4
lines changed
  • tools/SourceKit/bindings/python/sourcekitd

1 file changed

+4
-4
lines changed

tools/SourceKit/bindings/python/sourcekitd/capi.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ def __init__(self, value):
156156
if value >= len(ErrorKind._kinds):
157157
ErrorKind._kinds += [None] * (value - len(ErrorKind._kinds) + 1)
158158
if ErrorKind._kinds[value] is not None:
159-
raise ValueError,'ErrorKind already loaded'
159+
raise ValueError('ErrorKind already loaded')
160160
self.value = value
161161
ErrorKind._kinds[value] = self
162162
ErrorKind._name_map = None
@@ -177,7 +177,7 @@ def name(self):
177177
@staticmethod
178178
def from_id(id):
179179
if id >= len(ErrorKind._kinds) or ErrorKind._kinds[id] is None:
180-
raise ValueError,'Unknown type kind %d' % id
180+
raise ValueError('Unknown type kind {}'.format(id))
181181
return ErrorKind._kinds[id]
182182

183183
def __repr__(self):
@@ -239,7 +239,7 @@ def __init__(self, value):
239239
if value >= len(VariantType._kinds):
240240
VariantType._kinds += [None] * (value - len(VariantType._kinds) + 1)
241241
if VariantType._kinds[value] is not None:
242-
raise ValueError,'VariantType already loaded'
242+
raise ValueError('VariantType already loaded')
243243
self.value = value
244244
VariantType._kinds[value] = self
245245
VariantType._name_map = None
@@ -260,7 +260,7 @@ def name(self):
260260
@staticmethod
261261
def from_id(id):
262262
if id >= len(VariantType._kinds) or VariantType._kinds[id] is None:
263-
raise ValueError,'Unknown type kind %d' % id
263+
raise ValueError('Unknown type kind {}'.format(id))
264264
return VariantType._kinds[id]
265265

266266
def __repr__(self):

0 commit comments

Comments
 (0)