/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/_rio_py.py

  • Committer: Jelmer Vernooij
  • Date: 2017-05-22 00:56:52 UTC
  • mfrom: (6621.2.26 py3_pokes)
  • Revision ID: jelmer@jelmer.uk-20170522005652-yjahcr9hwmjkno7n
Merge Python3 porting work ('py3 pokes')

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 
21
21
import re
22
22
 
23
 
from breezy.rio import (
 
23
from .rio import (
24
24
    Stanza,
25
25
    )
26
26
 
27
27
_tag_re = re.compile(r'^[-a-zA-Z0-9_]+$')
28
28
def _valid_tag(tag):
29
 
    if type(tag) != str:
 
29
    if not isinstance(tag, str):
30
30
        raise TypeError(tag)
31
31
    return bool(_tag_re.match(tag))
32
32
 
34
34
def _read_stanza_utf8(line_iter):
35
35
    def iter_unicode_lines():
36
36
        for line in line_iter:
37
 
            if type(line) != str:
 
37
            if not isinstance(line, str):
38
38
                raise TypeError(line)
39
39
            yield line.decode('utf-8')
40
40
    return _read_stanza_unicode(iter_unicode_lines())