#NEWLINE# def _long_to_bytes( n , length , byteorder ) : #NEWLINE# #INDENT# 'Convert a long to a bytestring\n    For use in python version prior to 3.2\n    Source:\n    http://bugs.python.org/issue16580#msg177208\n    ' #NEWLINE# if ( byteorder == 'little' ) : #NEWLINE# #INDENT# indexes = range ( length ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# indexes = reversed ( range ( length ) ) #NEWLINE# #UNINDENT# return bytearray ( ( ( ( n >> ( i * 8 ) ) & 255 ) for i in indexes ) )