/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 bzrlib/_rio_py.py

  • Committer: Richard Wilbur
  • Date: 2016-02-04 19:07:28 UTC
  • mto: This revision was merged to the branch mainline in revision 6618.
  • Revision ID: richard.wilbur@gmail.com-20160204190728-p0zvfii6zase0fw7
Update COPYING.txt from the original http://www.gnu.org/licenses/gpl-2.0.txt  (Only differences were in whitespace.)  Thanks to Petr Stodulka for pointing out the discrepancy.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 
21
21
import re
22
22
 
23
 
from .rio import (
 
23
from bzrlib.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 not isinstance(tag, str):
 
29
    if type(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 not isinstance(line, bytes):
 
37
            if type(line) != str:
38
38
                raise TypeError(line)
39
39
            yield line.decode('utf-8')
40
40
    return _read_stanza_unicode(iter_unicode_lines())