/breezy/unstable

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

« back to all changes in this revision

Viewing changes to breezy/_rio_py.py

  • Committer: Jelmer Vernooij
  • Date: 2017-05-24 01:39:33 UTC
  • mfrom: (3815.3776.6)
  • Revision ID: jelmer@jelmer.uk-20170524013933-ir4y4tqtrsiz2ka2
New upstream snapshot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 
21
21
import re
22
22
 
23
 
from bzrlib.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())