[z3-checkins] r51875 - z3/deliverance/DeliveranceVHoster/trunk/dvhoster
ianb at codespeak.net
ianb at codespeak.net
Tue Feb 26 18:59:43 CET 2008
Author: ianb
Date: Tue Feb 26 18:59:41 2008
New Revision: 51875
Modified:
z3/deliverance/DeliveranceVHoster/trunk/dvhoster/util.py
Log:
Use execfile instead of exec
Modified: z3/deliverance/DeliveranceVHoster/trunk/dvhoster/util.py
==============================================================================
--- z3/deliverance/DeliveranceVHoster/trunk/dvhoster/util.py (original)
+++ z3/deliverance/DeliveranceVHoster/trunk/dvhoster/util.py Tue Feb 26 18:59:41 2008
@@ -15,12 +15,9 @@
if not os.path.exists(description):
raise OSError(
"No file exists by the name %r" % description)
- f = open(description, 'r')
- c = f.read()
- f.close()
- ns = {'__file__': os.path.abspath(description)}
- exec c in ns
- if default_name not in ns:
+ ns = {'__file__': description}
+ execfile(description, ns)
+ if not default_name in ns:
raise NameError(
"The file %r must provide a function by the name %s"
% (description, default_name))
More information about the z3-checkins
mailing list