mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-23 05:42:29 +00:00
python-3.6.zip added from Github
README.cosmo contains the necessary links.
This commit is contained in:
parent
75fc601ff5
commit
0c4c56ff39
4219 changed files with 1968626 additions and 0 deletions
3
third_party/python/Tools/test2to3/README
vendored
Normal file
3
third_party/python/Tools/test2to3/README
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
This project demonstrates how a distutils package
|
||||
can support Python 2.x and Python 3.x from a single
|
||||
source, using lib2to3.
|
10
third_party/python/Tools/test2to3/maintest.py
vendored
Executable file
10
third_party/python/Tools/test2to3/maintest.py
vendored
Executable file
|
@ -0,0 +1,10 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
# The above line should get replaced with the path to the Python
|
||||
# interpreter; the block below should get 2to3-converted.
|
||||
|
||||
try:
|
||||
from test2to3.hello import hello
|
||||
except ImportError, e:
|
||||
print "Import failed", e
|
||||
hello()
|
26
third_party/python/Tools/test2to3/setup.py
vendored
Normal file
26
third_party/python/Tools/test2to3/setup.py
vendored
Normal file
|
@ -0,0 +1,26 @@
|
|||
# -*- coding: iso-8859-1 -*-
|
||||
from distutils.core import setup
|
||||
|
||||
try:
|
||||
from distutils.command.build_py import build_py_2to3 as build_py
|
||||
except ImportError:
|
||||
from distutils.command.build_py import build_py
|
||||
|
||||
try:
|
||||
from distutils.command.build_scripts import build_scripts_2to3 as build_scripts
|
||||
except ImportError:
|
||||
from distutils.command.build_scripts import build_scripts
|
||||
|
||||
setup(
|
||||
name = "test2to3",
|
||||
version = "1.0",
|
||||
description = "2to3 distutils test package",
|
||||
author = "Martin v. Löwis",
|
||||
author_email = "python-dev@python.org",
|
||||
license = "PSF license",
|
||||
packages = ["test2to3"],
|
||||
scripts = ["maintest.py"],
|
||||
cmdclass = {'build_py': build_py,
|
||||
'build_scripts': build_scripts,
|
||||
}
|
||||
)
|
19
third_party/python/Tools/test2to3/test/runtests.py
vendored
Normal file
19
third_party/python/Tools/test2to3/test/runtests.py
vendored
Normal file
|
@ -0,0 +1,19 @@
|
|||
# Fictitious test runner for the project
|
||||
|
||||
import sys, os
|
||||
|
||||
if sys.version_info > (3,):
|
||||
# copy test suite over to "build/lib" and convert it
|
||||
from distutils.util import copydir_run_2to3
|
||||
testroot = os.path.dirname(__file__)
|
||||
newroot = os.path.join(testroot, '..', 'build/lib/test')
|
||||
copydir_run_2to3(testroot, newroot)
|
||||
# in the following imports, pick up the converted modules
|
||||
sys.path[0] = newroot
|
||||
|
||||
# run the tests here...
|
||||
|
||||
from test_foo import FooTest
|
||||
|
||||
import unittest
|
||||
unittest.main()
|
8
third_party/python/Tools/test2to3/test/test_foo.py
vendored
Normal file
8
third_party/python/Tools/test2to3/test/test_foo.py
vendored
Normal file
|
@ -0,0 +1,8 @@
|
|||
import sys
|
||||
import unittest
|
||||
|
||||
class FooTest(unittest.TestCase):
|
||||
def test_foo(self):
|
||||
# use 2.6 syntax to demonstrate conversion
|
||||
print 'In test_foo, using Python %s...' % (sys.version_info,)
|
||||
self.assertTrue(False)
|
1
third_party/python/Tools/test2to3/test2to3/__init__.py
vendored
Normal file
1
third_party/python/Tools/test2to3/test2to3/__init__.py
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
# empty
|
5
third_party/python/Tools/test2to3/test2to3/hello.py
vendored
Normal file
5
third_party/python/Tools/test2to3/test2to3/hello.py
vendored
Normal file
|
@ -0,0 +1,5 @@
|
|||
def hello():
|
||||
try:
|
||||
print "Hello, world"
|
||||
except IOError, e:
|
||||
print e.errno
|
Loading…
Add table
Add a link
Reference in a new issue