Skip to content

Commit

Permalink
socket_util.py: Make set_dscp() python 2.4.3 compatible.
Browse files Browse the repository at this point in the history
There is no 'errno' field in socket.error. Instead use the
get_exception_errno() function to get the error number.

Signed-off-by: Gurucharan Shetty <[email protected]>
Acked-by: Ben Pfaff <[email protected]>
  • Loading branch information
shettyg committed Jun 24, 2014
1 parent 0f1e8ed commit c620aaa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions python/ovs/socket_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,11 +302,11 @@ def set_dscp(sock, dscp):
try:
sock.setsockopt(socket.IPPROTO_IP, socket.IP_TOS, val)
except socket.error, e:
if e.errno != errno.ENOPROTOOPT:
if get_exception_errno(e) != errno.ENOPROTOOPT:
raise
success = True
try:
sock.setsockopt(socket.IPPROTO_IPV6, socket.IPV6_TCLASS, val)
except socket.error, e:
if e.errno != errno.ENOPROTOOPT or not success:
if get_exception_errno(e) != errno.ENOPROTOOPT or not success:
raise

0 comments on commit c620aaa

Please sign in to comment.