git » pyweave » commit 42b49d4

Do not output debug information by default

author Alberto Bertogli
2010-02-01 01:44:55 UTC
committer Alberto Bertogli
2010-02-01 01:45:41 UTC
parent 1d4d5580eb5c5f997499b91310309c7c552983d6

Do not output debug information by default

Signed-off-by: Alberto Bertogli <albertito@blitiri.com.ar>

pyweave.cgi +5 -0

diff --git a/pyweave.cgi b/pyweave.cgi
index 072b341..7f7d895 100755
--- a/pyweave.cgi
+++ b/pyweave.cgi
@@ -303,6 +303,7 @@ def path_info(path):
 	return p[1], p[2:]
 
 def debug(msg):
+	return
 	sys.stderr.write('DEBUG: ' + str(msg) + '\n')
 
 def error(http, msg = None):
@@ -485,7 +486,11 @@ def user_lock(user):
 def user_unlock(token):
 	"""Unlocks the given user. The token must be the one returned by
 	user_lock()."""
+	# Note we don't really need to do this, as the garbage collector
+	# should take care of disposing the fd as it's no longer needed, and
+	# the lock goes away on close(). We just do it to be tidy.
 	fcntl.lockf(token, fcntl.LOCK_UN)
+	token.close()
 
 def handle_cgi():
 	user = os.environ.get('REMOTE_USER', None)