[Checkins] SVN: zope.tal/trunk/src/zope/tal/ Remove the ancient setpath.py hack

Marius Gedminas cvs-admin at zope.org
Thu Feb 7 23:04:41 UTC 2013


Log message for revision 129189:
  Remove the ancient setpath.py hack
  
  Now you can debug failures by doing, e.g.
  
    .tox/py27/bin/python -m zope.tal.driver -s src/zope/tal/tests/input/test24.html
    .tox/py33/bin/python -m zope.tal.driver -s src/zope/tal/tests/input/test24.html
  
  and comparing the emitted bytecode.
  
  Note: if you want to use bin/py, you must also use -- to avoid a bug in
  buildout's interpreter wrapper script:
  
    bin/py -m zope.tal.driver -- -s src/zope/tal/tests/input/test24.html

Changed:
  U   zope.tal/trunk/src/zope/tal/driver.py
  D   zope.tal/trunk/src/zope/tal/setpath.py

-=-
Modified: zope.tal/trunk/src/zope/tal/driver.py
===================================================================
--- zope.tal/trunk/src/zope/tal/driver.py	2013-02-07 23:04:37 UTC (rev 129188)
+++ zope.tal/trunk/src/zope/tal/driver.py	2013-02-07 23:04:40 UTC (rev 129189)
@@ -44,9 +44,6 @@
 
 import getopt
 
-if __name__ == "__main__":
-    from . import setpath               # Local hack to tweak sys.path etc.
-
 # Import local classes
 import zope.tal.taldefs
 from zope.tal.dummyengine import DummyEngine

Deleted: zope.tal/trunk/src/zope/tal/setpath.py
===================================================================
--- zope.tal/trunk/src/zope/tal/setpath.py	2013-02-07 23:04:37 UTC (rev 129188)
+++ zope.tal/trunk/src/zope/tal/setpath.py	2013-02-07 23:04:40 UTC (rev 129189)
@@ -1,46 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2001, 2002 Zope Foundation and Contributors.
-# All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE.
-#
-##############################################################################
-"""Read a module search path from .path file.
-
-If .path file isn't found in the directory of the setpath.py module, then try
-to import ZODB.  If that succeeds, we assume the path is already set up
-correctly.  If that import fails, an IOError is raised.
-"""
-
-# TODO: Why does this want to find ZODB ???
-
-import os
-import sys
-
-dir = os.path.dirname(__file__)
-path = os.path.join(dir, ".path")
-try:
-    f = open(path)
-except IOError:
-    try:
-        # If we can import ZODB, our sys.path is set up well enough already
-        import ZODB
-    except ImportError:
-        raise IOError("Can't find ZODB package.  Please edit %s to point to "
-                      "your Zope's lib/python directory" % path)
-else:
-    for line in f.readlines():
-        line = line.strip()
-        if line and line[0] != '#':
-            for dir in line.split(os.pathsep):
-                dir = os.path.expanduser(os.path.expandvars(dir))
-                if dir not in sys.path:
-                    sys.path.append(dir)
-        # Must import this first to initialize Persistence properly
-        import ZODB



More information about the checkins mailing list