Skip to content

Commit

Permalink
Remove unused format_environ method in watchthreads APP
Browse files Browse the repository at this point in the history
It uses undefined variables that cause things like pyflakes
to be unhappy and in general dead code is concerning.
  • Loading branch information
cdent committed Apr 5, 2024
1 parent 7654dd8 commit cc0577f
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions paste/debug/watchthreads.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,29 +274,6 @@ def traceback_thread(thread_id):

hide_keys = ['paste.httpserver.thread_pool']

def format_environ(environ):
if environ is None:
return environ_template.substitute(
key='---',
value='No environment registered for this thread yet')
environ_rows = []
for key, value in sorted(environ.items()):
if key in hide_keys:
continue
try:
if key.upper() != key:
value = repr(value)
environ_rows.append(
environ_template.substitute(
key=cgi.escape(str(key)),
value=cgi.escape(str(value))))
except Exception as e:
environ_rows.append(
environ_template.substitute(
key=cgi.escape(str(key)),
value='Error in <code>repr()</code>: %s' % e))
return ''.join(environ_rows)

def format_time(time_length):
if time_length >= 60*60:
# More than an hour
Expand Down

0 comments on commit cc0577f

Please sign in to comment.