Skip to content

Commit

Permalink
"thread(s)" shell commands works with Python 3
Browse files Browse the repository at this point in the history
sys.maxint has been removed in Python 3
  • Loading branch information
tcalmant committed May 25, 2015
1 parent 260de66 commit b9ba76c
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions pelix/shell/core.py
Expand Up @@ -507,9 +507,9 @@ def threads_list(self, io_handler, max_depth=1):
try:
max_depth = int(max_depth)
if max_depth < 1:
max_depth = sys.maxint
max_depth = None
except (ValueError, TypeError):
max_depth = sys.maxint
max_depth = None

# pylint: disable=W0212
try:
Expand Down Expand Up @@ -544,7 +544,8 @@ def threads_list(self, io_handler, max_depth=1):
trace_lines = []
depth = 0
frame = stack
while frame is not None and depth < max_depth:
while frame is not None \
and (max_depth is None or depth < max_depth):
# Store the line information
trace_lines.append(self.__format_frame_info(frame))

Expand Down Expand Up @@ -572,9 +573,9 @@ def thread_details(self, io_handler, thread_id, max_depth=0):
try:
max_depth = int(max_depth)
if max_depth < 1:
max_depth = sys.maxint
max_depth = None
except (ValueError, TypeError):
max_depth = sys.maxint
max_depth = None

# pylint: disable=W0212
try:
Expand All @@ -600,7 +601,8 @@ def thread_details(self, io_handler, thread_id, max_depth=0):
trace_lines = []
depth = 0
frame = stack
while frame is not None and depth < max_depth:
while frame is not None \
and (max_depth is None or depth < max_depth):
# Store the line information
trace_lines.append(self.__format_frame_info(frame))

Expand Down

0 comments on commit b9ba76c

Please sign in to comment.