From f5c4ab8a709210f45b8e5fb25d72e1244c7c32a3 Mon Sep 17 00:00:00 2001 From: Carmelo Brianza Date: Tue, 14 Mar 2017 11:29:59 +0100 Subject: [PATCH 1/2] [README] Add building and installation instructions. --- README.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5788325..10ecda7 100644 --- a/README.md +++ b/README.md @@ -13,13 +13,22 @@ The following versions of Python are supported CPython 2.6+, 3.2+ and Pypy 2.1.0 Bugs and change requests can be made [here](https://github.com/tonysimpson/nanomsg-python/issues). - nanommsg library in /usr/local ============================== -If you're nanomsg is in /usr/local and your machine is not configured to find it there you can rename the usr_local_setup.cfg to setup.cfg to fix the problem. +If your nanomsg is in /usr/local and your machine is not configured to find it there you can rename the usr_local_setup.cfg to setup.cfg to fix the problem. + +Building and installing +======================= + +**You need to build and install [nanomsg](http://nanomsg.org/) in order to use +these bindings.** +1. Linux + * `cd /path/to/nanomsg-python` + * `python setup.py build` + * `sudo python setup.py install` Example ======= From d4dc3c0ef6a1c6ac8180c1231890a56d2f392c4c Mon Sep 17 00:00:00 2001 From: Carmelo Brianza Date: Mon, 24 Dec 2018 15:59:51 +0100 Subject: [PATCH 2/2] Fix _INT_PACKER format and get_int_option error message --- nanomsg/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nanomsg/__init__.py b/nanomsg/__init__.py index ab584dc..64bf8c1 100644 --- a/nanomsg/__init__.py +++ b/nanomsg/__init__.py @@ -159,7 +159,7 @@ class Socket(object): """ - _INT_PACKER = _Struct(str('l')) + _INT_PACKER = _Struct(str('i')) class _Endpoint(object): def __init__(self, socket, endpoint_id, address): @@ -382,7 +382,7 @@ def get_int_option(self, level, option): _nn_check_positive_rtn(rtn) if length != size: raise NanoMsgError(('Returned option size (%r) should be the same' - ' as size of int (%r)') % (rtn, size)) + ' as size of int (%r)') % (length, size)) return Socket._INT_PACKER.unpack_from(buffer(buf))[0] def get_string_option(self, level, option, max_len=16*1024):