/usr/lib/python2.7/dist-packages/stomp/backward.py is in python-stomp 4.1.19-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | import sys
"""Functions to support backwards compatibility.
Basically where we have functions which differ between python 2 and 3, we provide implementations here
and then Python-specific versions in backward2 and backward3.
"""
if sys.hexversion >= 0x03000000: # Python 3+
from stomp.backward3 import *
else: # Python 2
from stomp.backward2 import *
def get_errno(e):
"""
Return the errno of an exception, or the first argument if errno is not available.
:param Exception e: the exception object
"""
try:
return e.errno
except AttributeError:
return e.args[0]
try:
from time import monotonic
except ImportError: # Python < 3.3/3.5
from time import time as monotonic
|