diff options
author | Ross Burton <ross.burton@intel.com> | 2020-01-20 17:14:33 +0000 |
---|---|---|
committer | Tim Orling <ticotimo@gmail.com> | 2020-01-20 09:33:23 -0800 |
commit | 39ddef6a83eb43857f3d46296a30f68ac27e89d5 (patch) | |
tree | 5fc63f954a35455338705b061d74c834c21dc200 /recipes-devtools/python/python/sitecustomize.py | |
parent | 909fd91182e55a6e5147ab8bf3e6d56e77b9fef0 (diff) | |
download | meta-python2-39ddef6a83eb43857f3d46296a30f68ac27e89d5.tar.gz |
python: add 2.7.17 from oe-core
Python 2 ceased being maintained on the 1st January 2020. All users of
Python 2 in oe-core have already been ported to Python 3, so in oe-core
390f3eda Python 2 was finally removed from oe-core itself.
The following are added to meta-python2 in this commit:
- python and python-native 2.7.17
- python-setuptools
- The classes pythonnative, pythondir, distutils, setuptools
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Tim Orling <ticotimo@gmail.com>
Diffstat (limited to 'recipes-devtools/python/python/sitecustomize.py')
-rw-r--r-- | recipes-devtools/python/python/sitecustomize.py | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/recipes-devtools/python/python/sitecustomize.py b/recipes-devtools/python/python/sitecustomize.py new file mode 100644 index 0000000..4c8b5e2 --- /dev/null +++ b/recipes-devtools/python/python/sitecustomize.py @@ -0,0 +1,37 @@ +# OpenEmbedded sitecustomize.py (C) 2002-2008 Michael 'Mickey' Lauer <mlauer@vanille-media.de> +# GPLv2 or later +# Version: 20081123 +# Features: +# * set proper default encoding +# * enable readline completion in the interactive interpreter +# * load command line history on startup +# * save command line history on exit + +import os + +def __exithandler(): + try: + readline.write_history_file( "%s/.python-history" % os.getenv( "HOME", "/tmp" ) ) + except IOError: + pass + +def __registerExitHandler(): + import atexit + atexit.register( __exithandler ) + +def __enableReadlineSupport(): + readline.set_history_length( 1000 ) + readline.parse_and_bind( "tab: complete" ) + try: + readline.read_history_file( "%s/.python-history" % os.getenv( "HOME", "/tmp" ) ) + except IOError: + pass + +import sys +try: + import rlcompleter, readline +except ImportError: + pass +else: + __registerExitHandler() + __enableReadlineSupport() |