Commit 0faf10bc authored by Jim Fulton's avatar Jim Fulton

Moved a global declaration to the top of a function to make Python2.1 happy.

parent 1b7aef1d
...@@ -84,8 +84,8 @@ ...@@ -84,8 +84,8 @@
############################################################################## ##############################################################################
__doc__="""Python Object Publisher -- Publish Python objects on web servers __doc__="""Python Object Publisher -- Publish Python objects on web servers
$Id: Publish.py,v 1.148 2001/02/23 20:40:45 shane Exp $""" $Id: Publish.py,v 1.149 2001/04/01 17:47:04 jim Exp $"""
__version__='$Revision: 1.148 $'[11:-2] __version__='$Revision: 1.149 $'[11:-2]
import sys, os import sys, os
from string import lower, atoi, rfind, strip from string import lower, atoi, rfind, strip
...@@ -377,6 +377,7 @@ if os.environ.get('PROFILE_PUBLISHER', None): ...@@ -377,6 +377,7 @@ if os.environ.get('PROFILE_PUBLISHER', None):
def publish_module(module_name, stdin=sys.stdin, stdout=sys.stdout, def publish_module(module_name, stdin=sys.stdin, stdout=sys.stdout,
stderr=sys.stderr, environ=os.environ, debug=0, stderr=sys.stderr, environ=os.environ, debug=0,
request=None, response=None): request=None, response=None):
global _pstat
_plock.acquire() _plock.acquire()
try: try:
if request is not None: if request is not None:
...@@ -392,7 +393,6 @@ if os.environ.get('PROFILE_PUBLISHER', None): ...@@ -392,7 +393,6 @@ if os.environ.get('PROFILE_PUBLISHER', None):
result=sys._pr_ result=sys._pr_
pobj.create_stats() pobj.create_stats()
if _pstat is None: if _pstat is None:
global _pstat
_pstat=sys._ps_=pstats.Stats(pobj) _pstat=sys._ps_=pstats.Stats(pobj)
else: _pstat.add(pobj) else: _pstat.add(pobj)
finally: finally:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment