Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

More fixes for python 2.4 support

  • Loading branch information...
commit fe40c5d81c710b9886718a4cb1080fd4f9b70cf8 1 parent 59fde18
David LaBissoniere labisso authored
Showing with 15 additions and 12 deletions.
  1. +8 −5 home/sbin/setup.py
  2. +7 −7 web/src/python/nimbusweb/setup/pathutil.py
13 home/sbin/setup.py
View
@@ -355,12 +355,15 @@ def main(argv=None):
if opts.configpath:
log.debug("saving settings to %s" % opts.configpath)
try:
- f = open(opts.configpath, 'wb')
- config.write(f)
- except:
- log.info("Failed to save settings to %s!" % opts.configpath)
+ f = None
+ try:
+ f = open(opts.configpath, 'wb')
+ config.write(f)
+ except:
+ log.info("Failed to save settings to %s!" % opts.configpath)
finally:
- f.close()
+ if f:
+ f.close()
except InvalidInput, e:
msg = "\nProblem with input: %s" % e.msg
14 web/src/python/nimbusweb/setup/pathutil.py
View
@@ -164,13 +164,6 @@ def write_repl_file(path, outputtext, log):
log.debug("Wrote '%s'." % path)
-relpath = None
-try:
- # os.path.relpath is in 2.6+
- relpath = getattr(os.path, 'relpath')
-except AttributeError:
- relpath = _relpath
-
# from Python 2.6 standard library, slightly modified
def _relpath(path, start):
"""Return a relative version of a path"""
@@ -190,3 +183,10 @@ def _relpath(path, start):
if not rel_list:
return curdir
return os.path.join(*rel_list)
+
+relpath = None
+try:
+ # os.path.relpath is in 2.6+
+ relpath = getattr(os.path, 'relpath')
+except AttributeError:
+ relpath = _relpath
Please sign in to comment.
Something went wrong with that request. Please try again.