[PATCH] D56256: Python compat - exception
Phabricator via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 3 06:16:55 PST 2019
This revision was automatically updated to reflect the committed changes.
Closed by commit rL350311: Python compat - portable way of raising exceptions (authored by serge_sans_paille, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D56256?vs=180019&id=180056#toc
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D56256/new/
https://reviews.llvm.org/D56256
Files:
llvm/trunk/test/tools/llvm-readobj/Inputs/relocs.py
Index: llvm/trunk/test/tools/llvm-readobj/Inputs/relocs.py
===================================================================
--- llvm/trunk/test/tools/llvm-readobj/Inputs/relocs.py
+++ llvm/trunk/test/tools/llvm-readobj/Inputs/relocs.py
@@ -44,17 +44,17 @@
# Not supported (Enums are immutable).
def __setattr__(self, name, value):
- raise NotSupportedException, self.__setattr__
+ raise NotSupportedException(self.__setattr__)
# Not supported (Enums are immutable).
def __delattr__(self, name):
- raise NotSupportedException, self.__delattr__
+ raise NotSupportedException(self.__delattr__)
# Gets the enum symbol for the specified value.
def __getitem__(self, value):
symbol = self._map.get(value)
if symbol is None:
- raise KeyError, value
+ raise KeyError(value)
return symbol
# Gets the enum symbol for the specified value or none.
@@ -64,11 +64,11 @@
# Not supported (Enums are immutable).
def __setitem__(self, value, symbol):
- raise NotSupportedException, self.__setitem__
+ raise NotSupportedException(self.__setitem__)
# Not supported (Enums are immutable).
def __delitem__(self, value):
- raise NotSupportedException, self.__delitem__
+ raise NotSupportedException(self.__delitem__)
def entries(self):
# sort by (value, name)
@@ -101,7 +101,7 @@
def read(self, N):
data = self.file.read(N)
if len(data) != N:
- raise ValueError, "Out of data!"
+ raise ValueError("Out of data!")
return data
def int8(self):
@@ -267,7 +267,7 @@
elif fileclass == 2:
f.is64Bit = True
else:
- raise ValueError, "Unknown file class %x" % fileclass
+ raise ValueError("Unknown file class %x" % fileclass)
byteordering = f.uint8()
if byteordering == 1:
@@ -275,7 +275,7 @@
elif byteordering == 2:
f.isLSB = False
else:
- raise ValueError, "Unknown byte ordering %x" % byteordering
+ raise ValueError("Unknown byte ordering %x" % byteordering)
f.seek(18)
e_machine = f.uint16()
@@ -376,7 +376,7 @@
elif magic == '\xCF\xFA\xED\xFE':
f.isLSB, f.is64Bit = True, True
else:
- raise ValueError,"Not a Mach-O object file: %r (bad magic)" % path
+ raise ValueError("Not a Mach-O object file: %r (bad magic)" % path)
cputype = f.uint32()
cpusubtype = f.uint32()
@@ -393,8 +393,8 @@
patchMachoLoadCommand(f, relocs)
if f.tell() - start != loadCommandsSize:
- raise ValueError,"%s: warning: invalid load commands size: %r" % (
- sys.argv[0], loadCommandsSize)
+ raise ValueError("%s: warning: invalid load commands size: %r" % (
+ sys.argv[0], loadCommandsSize))
def patchMachoLoadCommand(f, relocs):
start = f.tell()
@@ -409,8 +409,8 @@
f.read(cmdSize - 8)
if f.tell() - start != cmdSize:
- raise ValueError,"%s: warning: invalid load command size: %r" % (
- sys.argv[0], cmdSize)
+ raise ValueError("%s: warning: invalid load command size: %r" % (
+ sys.argv[0], cmdSize))
def patchMachoSegmentLoadCommand(f, relocs):
segment_name = f.read(16)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D56256.180056.patch
Type: text/x-patch
Size: 3108 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190103/ba4b2f93/attachment.bin>
More information about the llvm-commits
mailing list