diff --git a/mercurial/statprof.py b/mercurial/statprof.py --- a/mercurial/statprof.py +++ b/mercurial/statprof.py @@ -910,17 +910,17 @@ optstart = 2 displayargs['function'] = None - if argv[1] == 'hotpath': + if argv[1] == r'hotpath': displayargs['format'] = DisplayFormats.Hotpath - elif argv[1] == 'lines': + elif argv[1] == r'lines': displayargs['format'] = DisplayFormats.ByLine - elif argv[1] == 'functions': + elif argv[1] == r'functions': displayargs['format'] = DisplayFormats.ByMethod - elif argv[1] == 'function': + elif argv[1] == r'function': displayargs['format'] = DisplayFormats.AboutMethod displayargs['function'] = argv[2] optstart = 3 - elif argv[1] == 'flame': + elif argv[1] == r'flame': displayargs['format'] = DisplayFormats.FlameGraph else: printusage() @@ -938,22 +938,22 @@ displayargs['limit'] = 0.05 path = None for o, value in opts: - if o in ("-l", "--limit"): + if o in (r"-l", r"--limit"): displayargs['limit'] = float(value) - elif o in ("-f", "--file"): + elif o in (r"-f", r"--file"): path = value - elif o in ("-o", "--output-file"): + elif o in (r"-o", r"--output-file"): displayargs['outputfile'] = value - elif o in ("-p", "--script-path"): + elif o in (r"-p", r"--script-path"): displayargs['scriptpath'] = value - elif o in ("-h", "help"): + elif o in (r"-h", r"help"): printusage() return 0 else: assert False, "unhandled option %s" % o if not path: - print('must specify --file to load') + print(r'must specify --file to load') return 1 load_data(path=path) @@ -962,5 +962,5 @@ return 0 -if __name__ == "__main__": +if __name__ == r"__main__": sys.exit(main())