[Zope-Checkins] CVS: Zope/lib/python/Zope/Startup/tests - test_schema.py:1.8
Fred L. Drake, Jr.
fred@zope.com
Thu, 24 Jul 2003 01:20:23 -0400
Update of /cvs-repository/Zope/lib/python/Zope/Startup/tests
In directory cvs.zope.org:/tmp/cvs-serv5454
Modified Files:
test_schema.py
Log Message:
simplify getSchema(); this version is more robust in locating the
ZConfig schema for Zope, and requires less magic
=== Zope/lib/python/Zope/Startup/tests/test_schema.py 1.7 => 1.8 ===
--- Zope/lib/python/Zope/Startup/tests/test_schema.py:1.7 Mon Jul 21 16:56:27 2003
+++ Zope/lib/python/Zope/Startup/tests/test_schema.py Thu Jul 24 01:20:19 2003
@@ -30,14 +30,8 @@
TEMPNAME = tempfile.mktemp()
TEMPPRODUCTS = os.path.join(TEMPNAME, "Products")
-try:
- __file__
-except NameError:
- import sys
- __file__ = sys.argv[0]
-
def getSchema():
- startup = os.path.dirname(os.path.dirname(__file__))
+ startup = os.path.dirname(os.path.realpath(Zope.Startup.__file__))
schemafile = os.path.join(startup, 'zopeschema.xml')
return ZConfig.loadSchema(schemafile)