__init__.py 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. """
  2. Copyright (c) 2015, 2018, 2020-2022 by Rocky Bernstein
  3. Copyright (c) 2000 by hartmut Goebel <h.goebel@crazy-compilers.com>
  4. Copyright (c) 1999 John Aycock
  5. Permission is hereby granted, free of charge, to any person obtaining
  6. a copy of this software and associated documentation files (the
  7. "Software"), to deal in the Software without restriction, including
  8. without limitation the rights to use, copy, modify, merge, publish,
  9. distribute, sublicense, and/or sell copies of the Software, and to
  10. permit persons to whom the Software is furnished to do so, subject to
  11. the following conditions:
  12. The above copyright notice and this permission notice shall be
  13. included in all copies or substantial portions of the Software.
  14. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  15. EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  16. MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  17. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
  18. CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
  19. TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
  20. SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  21. NB. This is not a masterpiece of software, but became more like a hack.
  22. Probably a complete rewrite would be sensefull. hG/2000-12-27
  23. """
  24. import sys
  25. __docformat__ = "restructuredtext"
  26. if hasattr(sys, "setrecursionlimit"):
  27. # pyston doesn't have setrecursionlimit
  28. sys.setrecursionlimit(5000)
  29. # Export some convenience functions so you can say:
  30. # from decompyle3 import (code_deparse, deparse_code2str)
  31. from decompyle3.main import decompile_file
  32. from decompyle3.semantics import fragments, pysource
  33. from decompyle3.semantics.pysource import code_deparse, deparse_code2str
  34. from decompyle3.version import __version__
  35. __all__ = [
  36. "__version__",
  37. "code_deparse",
  38. "decompile_file",
  39. "deparse_code2str",
  40. "fragments",
  41. "pysource",
  42. ]