enable_shared_from_this.py 599 B

1234567891011121314151617181920212223242526
  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)
  4. '''
  5. >>> from enable_shared_from_this_ext import *
  6. >>> x = Test.construct()
  7. >>> x.take(x)
  8. >>> x.act()
  9. '''
  10. def run(args = None):
  11. import sys
  12. import doctest
  13. if args is not None:
  14. sys.argv = args
  15. return doctest.testmod(sys.modules.get(__name__))
  16. if __name__ == '__main__':
  17. print("running...")
  18. import sys
  19. status = run()[0]
  20. if (status == 0): print("Done.")
  21. sys.exit(status)