File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- from _version import __version__
1+ from . _version import __version__
22
33# shortcut for most-used symbols
44from msgpackrpc .loop import Loop
Original file line number Diff line number Diff line change @@ -6,6 +6,12 @@ def force_str(s):
66 if isinstance (s , bytes ):
77 return s .decode ('utf-8' )
88 return str (s )
9+
10+ def iteritems (d ):
11+ return d .items ()
912else :
1013 def force_str (s ):
1114 return str (s )
15+
16+ def iteritems (d ):
17+ return d .iteritems ()
Original file line number Diff line number Diff line change 55from msgpackrpc .error import RPCError
66from msgpackrpc .future import Future
77from msgpackrpc .transport import tcp
8+ from msgpackrpc .compat import iteritems
89
910
1011class Session (object ):
@@ -70,8 +71,7 @@ def on_connect_failed(self, reason):
7071 Called by the transport layer.
7172 """
7273 # set error for all requests
73- #for msgid, future in self._request_table.iteritems():
74- for msgid , future in _iteritems (self ._request_table ):
74+ for msgid , future in iteritems (self ._request_table ):
7575 future .set_error (reason )
7676
7777 self ._request_table = {}
@@ -102,7 +102,7 @@ def on_timeout(self, msgid):
102102
103103 def step_timeout (self ):
104104 timeouts = []
105- for msgid , future in self ._request_table . iteritems ( ):
105+ for msgid , future in iteritems ( self ._request_table ):
106106 if future .step_timeout ():
107107 timeouts .append (msgid )
108108
Original file line number Diff line number Diff line change 11#!/usr/bin/env python
22# coding: utf-8
33
4- import distutils .core
5- import sys
6-
7- # Avoid importing msgpackrpc to make sdist without installing
8- # requiring packages.
4+ # Define __version__ without importing msgpackrpc.
5+ # This allows building sdist without installing any 3rd party packages.
96exec (open ('msgpackrpc/_version.py' ).read ())
107
118try :
129 from setuptools import setup
1310except ImportError :
14- setup = distutils .core .setup
15-
16- kwargs = {}
17- major , minor = sys .version_info [:2 ]
18- if major == 3 :
19- import setuptools # setuptools is required for use_2to3
20- kwargs ["use_2to3" ] = True
11+ from distutils .core import setup
2112
2213setup (name = 'msgpack-rpc-python' ,
2314 version = __version__ ,
3728 'Programming Language :: Python :: 2' ,
3829 'Programming Language :: Python :: 3' ,
3930 'License :: OSI Approved :: Apache Software License' ],
40- ** kwargs
4131 )
You can’t perform that action at this time.
0 commit comments