Wanted: a python24 package for Python 2.3

Gerald Klix Gerald.Klix at klix.ch
Tue Mar 20 12:26:40 EDT 2007


Hi,
You can't import subproces from future, only syntactic and semantic 
changes that will become standard feature in future python version can 
be activated that way.

You can copy the subprocess module from python 2.4 somewhere where it 
will be found from python 2.3. At least subporcess is importable after that:

--- snip ---
klix at vesuv6:~/ttt> cp -av /usr/local/lib/python2.4/subprocess.py .
»/usr/local/lib/python2.4/subprocess.py« -> »./subprocess.py«
klix at vesuv6:~/ttt> python2.3
Python 2.3.3 (#1, Jun 29 2004, 14:43:40)
[GCC 3.3 20030226 (prerelease) (SuSE Linux)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
 >>> import subprocess
 >>>
--- snip ---

HTH,
Gerald

kyosohma at gmail.com schrieb:
> On Mar 20, 10:33 am, Jonathan Fine <j... at pytex.org> wrote:
> 
>>Hello
>>
>>My problem is that I want a Python 2.4 module on
>>a server that is running Python 2.3.  I definitely
>>want to use the 2.4 module, and I don't want to
>>require the server to move to Python 2.4.
>>
>>More exactly, I am using subprocess, which is
>>new in Python 2.4.  What I am writing is something
>>like
>>===
>>from subprocess import Popen
>>===
>>
>>This will fail in Python 2.3, in which case I
>>would like to write something like
>>===
>>try:
>>     from subprocess import Popen
>>else ImportError:
>>     from somewhere_else import Popen
>>===
>>
>>Put this way, it is clear (to me) that somewhere_else
>>should be python24.
>>
>>In other words, I'm asking for a python24 package that
>>contains all (or most) of the modules that are new to
>>Python 2.4.
>>
>>I've looked around a bit, and it seems that this
>>formulation of the solution is new.  I wonder if
>>anyone else has encountered this problem, or has
>>comments on my solution.
>>
>>--
>>Jonathan
> 
> 
> You might be able to use the "from future import SomeModule" syntax to
> accomplish this, but I am not sure. Other than that, I would just
> recommend using the os.popen calls that are native to 2.3
> 
> Mike
> 




More information about the Python-list mailing list