Skip to content

Commit

Permalink
Bump version and fix minor linter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Erotemic committed Dec 9, 2022
1 parent 119b577 commit 6ee9f63
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
Changes
=======

4.0.2
~~~~~
* FIX: AttributeError on certain methods. #191

4.0.1
~~~~~
* FIX: Profiling classmethods works again. #183
Expand Down
14 changes: 7 additions & 7 deletions kernprof.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
import os
import sys
import threading
import asyncio
import concurrent.futures
import asyncio # NOQA
import concurrent.futures # NOQA
import time
from argparse import ArgumentError, ArgumentParser

# NOTE: This version needs to be manually maintained with the line_profiler
# __version__ for now.
__version__ = '4.0.1'
__version__ = '4.0.2'

# Guard the import of cProfile such that 3.x people
# without lsprof can still use this script.
Expand Down Expand Up @@ -132,7 +132,7 @@ def __exit__(self, exc_type, exc_val, exc_tb):
class RepeatedTimer(object):
"""
Background timer for outputting file every n seconds.
Adapted from
https://stackoverflow.com/questions/474528/what-is-the-best-way-to-repeatedly-execute-a-function-every-x-seconds/40965385#40965385
"""
Expand Down Expand Up @@ -161,6 +161,7 @@ def stop(self):
self._timer.cancel()
self.is_running = False


def find_script(script_name):
""" Find the script.
Expand Down Expand Up @@ -209,8 +210,8 @@ def positive_float(value):
parser.add_argument('-z', '--skip-zero', action='store_true',
help="Hide functions which have not been called")
parser.add_argument('-i', '--output-interval', type=int, default=0, const=0, nargs='?',
help="Enables outputting of cumulative profiling results to file every n seconds. Uses the threading module."
"Minimum value is 1 (second). Defaults to disabled.")
help="Enables outputting of cumulative profiling results to file every n seconds. Uses the threading module."
"Minimum value is 1 (second). Defaults to disabled.")

parser.add_argument('script', help='The python script file to run')
parser.add_argument('args', nargs='...', help='Optional script arguments')
Expand Down Expand Up @@ -250,7 +251,6 @@ def positive_float(value):
# kernprof.py's.
sys.path.insert(0, os.path.dirname(script_file))


if options.output_interval:
rt = RepeatedTimer(max(options.output_interval, 1), prof.dump_stats, options.outfile)
original_stdout = sys.stdout
Expand Down
4 changes: 3 additions & 1 deletion line_profiler/line_profiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
f'Has it been compiled? Underlying error is ex={ex!r}'
)

__version__ = '4.0.1'
__version__ = '4.0.2'


def load_ipython_extension(ip):
Expand All @@ -39,9 +39,11 @@ def is_generator(f):
isgen = (f.__code__.co_flags & CO_GENERATOR) != 0
return isgen


def is_classmethod(f):
return isinstance(f, classmethod)


class LineProfiler(CLineProfiler):
""" A profiler that records the execution times of individual lines.
"""
Expand Down

0 comments on commit 6ee9f63

Please sign in to comment.