pombreda / python-nose

Automatically exported from code.google.com/p/python-nose
0 stars 0 forks source link

syntax error under python2.3 #414

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Older versions of python don't have the "from x import ()" syntax.

There's actually no need for the complicated syntax here, since the import 
statement does the desired assignment.

--- a/nose/plugins/multiprocess.py      Mon Apr 25 14:07:00 2011 -0500
+++ b/nose/plugins/multiprocess.py      Mon Apr 25 17:16:02 2011 -0700
@@ -139,11 +139,7 @@
 def _import_mp():
     global Process, Queue, Pool, Event, Value, Array
     try:
-        from multiprocessing import (Process as Process_, Queue as Queue_,
-                                     Pool as Pool_, Event as Event_,
-                                     Value as Value_, Array as Array_)
-        Process, Queue, Pool, Event, Value, Array = (Process_, Queue_, Pool_,
-                                                     Event_, Value_, Array_)
+        from multiprocessing import Process, Queue, Pool, Event, Value, Array
     except ImportError:
         warn("multiprocessing module is not available, multiprocess plugin "
              "cannot be used", RuntimeWarning)

Original issue reported on code.google.com by workitha...@gmail.com on 26 Apr 2011 at 12:18

GoogleCodeExporter commented 9 years ago
We are no longer supporting Python 2.3, just 2.4 and up.

I believe the underscores are there just in case a partial import occurs (like 
if one of those classes gets renamed in the future). In that case it would be 
confusing if only part of the system worked after the warning was issued.  It 
is a bit weird though.

Original comment by kumar.mcmillan on 26 Apr 2011 at 3:00