Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Port from python 2.5-2.7 to 2.6-2.7/3.2+. #4

Merged
merged 1 commit into from Oct 31, 2012
Commits on Oct 31, 2012
  1. Port from python 2.5-2.7 to 2.6-2.7/3.2+.

    abarnert committed Oct 31, 2012
    - Besides the trivial syntax changes, this required changing the
      Connection.write_line loop to keep _wbuffer as a flat bytes string
      instead of a list of strings. (Since it was already flattening each
      string and then exploding it into a list of 1-char strings, there's
      no performance downside to thsi change.)
    
    - As a side-effect of the changes, Connection.write and friends can
      now handle either bytes or unicode strings. Since the high-level
      methods are all in terms of JSON objects, this only really makes a
      difference for debugging bjsonrpc itself. (The json module will
      only give us str objects--bytes on 2.x, unicode on 3.x--and any
      non-ASCII characters will already be escaped for JSON anyway.)