[pypy-svn] r61211 - pypy/trunk/pypy/translator/platform

afa at codespeak.net afa at codespeak.net
Thu Jan 22 01:03:19 CET 2009


Author: afa
Date: Thu Jan 22 01:03:19 2009
New Revision: 61211

Modified:
   pypy/trunk/pypy/translator/platform/__init__.py
Log:
host_factory is the class used to build the 'host' instance.

The next step is to turn some factories into functions that return 
different kind of Platforms depending on the 'cc' parameter.


Modified: pypy/trunk/pypy/translator/platform/__init__.py
==============================================================================
--- pypy/trunk/pypy/translator/platform/__init__.py	(original)
+++ pypy/trunk/pypy/translator/platform/__init__.py	Thu Jan 22 01:03:19 2009
@@ -152,32 +152,32 @@
     from pypy.translator.platform.linux import Linux, Linux64
     import platform
     if platform.architecture()[0] == '32bit':
-        host = Linux()
+        host_factory = Linux
     else:
-        host = Linux64()
+        host_factory = Linux64
 elif sys.platform == 'darwin':
     from pypy.translator.platform.darwin import Darwin
-    host = Darwin()
+    host_factory = Darwin
 elif sys.platform == 'freebsd7':
     from pypy.translator.platform.freebsd7 import Freebsd7, Freebsd7_64
     import platform
     if platform.architecture()[0] == '32bit':
-        host = Freebsd7()
+        host_factory = Freebsd7
     else:
-        host = Freebsd7_64()
+        host_factory = Freebsd7_64
 elif os.name == 'nt':
     from pypy.translator.platform.windows import Windows
-    host = Windows()
+    host_factory = Windows
 else:
     # pray
     from pypy.translator.platform.distutils_platform import DistutilsPlatform
-    host = DistutilsPlatform()
+    host_factory = DistutilsPlatform
 
-platform = host
+platform = host = host_factory()
 
 def pick_platform(new_platform, cc):
     if new_platform == 'host':
-        return host.__class__(cc)
+        return host_factory(cc)
     elif new_platform == 'maemo':
         from pypy.translator.platform.maemo import Maemo
         return Maemo(cc)



More information about the Pypy-commit mailing list