1# Copyright David Abrahams 2004. Distributed under the Boost 2# Software License, Version 1.0. (See accompanying 3# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 4import sys 5if (sys.version_info.major >= 3): 6 long = int 7''' 8>>> from long_ext import * 9>>> print(new_long()) 100 11>>> print(longify(42)) 1242 13>>> print(longify_string('300')) 14300 15>>> is_long(long(20)) 16'yes' 17>>> is_long('20') 180 19 20>>> x = Y(long(4294967295)) 21''' 22 23def run(args = None): 24 import sys 25 import doctest 26 27 if args is not None: 28 sys.argv = args 29 return doctest.testmod(sys.modules.get(__name__)) 30 31if __name__ == '__main__': 32 print("running...") 33 import sys 34 status = run()[0] 35 if (status == 0): print("Done.") 36 sys.exit(status) 37