/breezy/3.0

To get this branch, use:
bzr branch https://code.breezy-vcs.org/breezy/3.0

« back to all changes in this revision

Viewing changes to breezy/export_pot.py

  • Committer: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2020-02-07 01:31:19 UTC
  • mfrom: (7339.1.1 3.8-compat)
  • Revision ID: breezy.the.bot@gmail.com-20200207013119-gjgp9hj299ybun6d
More improvements to make tests success with Python 3.8.

Merged from https://code.launchpad.net/~jelmer/brz/3.8-compat/+merge/378691

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
 
31
31
import inspect
32
32
import os
 
33
import sys
33
34
 
34
35
import breezy
35
36
from . import (
87
88
            # string terminates on. It's more useful to have the line the
88
89
            # string begins on. Unfortunately, counting back newlines is
89
90
            # only an approximation as the AST is ignorant of escaping.
90
 
            str_to_lineno[node.s] = node.lineno - node.s.count('\n')
 
91
            str_to_lineno[node.s] = node.lineno - (0 if sys.version_info >= (3, 8) else node.s.count('\n'))
91
92
    return cls_to_lineno, str_to_lineno
92
93
 
93
94