New version
- Add a docstring to python bindings (vpodzime) - Neutralize None as an operand for math operations (vpodzime) - Add targets for checking and installing test requirements (vpodzime) - Fix 'make local' (vtrefny) - Make the python packages own their package directories (vpodzime) - Don't compare translated and untranslated representations (vpodzime) - replace_char_with_str: Fix the character count. (dshea) - Ditch autopoint. (dshea)
This commit is contained in:
parent
aee06e8d7e
commit
0bac08b10c
1
.gitignore
vendored
1
.gitignore
vendored
@ -5,3 +5,4 @@
|
||||
/libbytesize-0.5.tar.gz
|
||||
/libbytesize-0.6.tar.gz
|
||||
/libbytesize-0.7.tar.gz
|
||||
/libbytesize-0.8.tar.gz
|
||||
|
||||
@ -1,35 +0,0 @@
|
||||
From 66851cc2630f7089d2de2bba054418cfd16563ad Mon Sep 17 00:00:00 2001
|
||||
From: Vratislav Podzimek <vpodzime@redhat.com>
|
||||
Date: Thu, 15 Sep 2016 10:56:36 +0200
|
||||
Subject: [PATCH] Prevent ignored exceptions in __del__ from happening
|
||||
|
||||
For some reason we cannot call the functions from the loaded libbytesize C
|
||||
library in some cases when __del__ is called. Let's just prevent the ignored
|
||||
exceptions from happening.
|
||||
|
||||
Resolves: gh#19
|
||||
Signed-off-by: Vratislav Podzimek <vpodzime@redhat.com>
|
||||
---
|
||||
src/python/bytesize.py | 6 +++++-
|
||||
1 file changed, 5 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/python/bytesize.py b/src/python/bytesize.py
|
||||
index ec4b279..b68c5c4 100644
|
||||
--- a/src/python/bytesize.py
|
||||
+++ b/src/python/bytesize.py
|
||||
@@ -97,7 +97,11 @@ class SizeStruct(ctypes.Structure):
|
||||
return c_bytesize.bs_size_new_from_size(sz).contents
|
||||
|
||||
def __del__(self):
|
||||
- c_bytesize.bs_size_free(self)
|
||||
+ # XXX: For some reason c_bytesize may be None here (probably when python
|
||||
+ # cleans up after itself) and loading it again doesn't work at that
|
||||
+ # stage. Let's just prevent ignored exceptions from happening.
|
||||
+ if c_bytesize:
|
||||
+ c_bytesize.bs_size_free(self)
|
||||
|
||||
def get_bytes(self):
|
||||
sgn = ctypes.c_int(0)
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@ -1,13 +1,11 @@
|
||||
Name: libbytesize
|
||||
Version: 0.7
|
||||
Release: 4%{?dist}
|
||||
Version: 0.8
|
||||
Release: 1%{?dist}
|
||||
Summary: A library for working with sizes in bytes
|
||||
License: LGPLv2+
|
||||
URL: https://github.com/rhinstaller/libbytesize
|
||||
Source0: https://github.com/rhinstaller/libbytesize/archive/%{name}-%{version}.tar.gz
|
||||
|
||||
Patch0: except_in_del.patch
|
||||
|
||||
%define realname bytesize
|
||||
|
||||
BuildRequires: gmp-devel
|
||||
@ -53,7 +51,6 @@ the library from Python 3 easier and more convenient.
|
||||
|
||||
%prep
|
||||
%setup -q -n %{name}-%{version}
|
||||
%patch0 -p1
|
||||
|
||||
%build
|
||||
%configure
|
||||
@ -83,13 +80,25 @@ find %{buildroot} -type f -name "*.la" | xargs %{__rm}
|
||||
%{_datadir}/gtk-doc/html/libbytesize
|
||||
|
||||
%files -n python-%{realname}
|
||||
%dir %{python2_sitearch}/bytesize
|
||||
%{python2_sitearch}/bytesize/*
|
||||
|
||||
%files -n python3-%{realname}
|
||||
%dir %{python3_sitearch}/bytesize
|
||||
%{python3_sitearch}/bytesize/*
|
||||
%{python3_sitearch}/bytesize/__pycache__/*
|
||||
|
||||
%changelog
|
||||
* Fri Dec 16 2016 Vratislav Podzimek <vpodzime@redhat.com> - 0.8-1
|
||||
- Add a docstring to python bindings (vpodzime)
|
||||
- Neutralize None as an operand for math operations (vpodzime)
|
||||
- Add targets for checking and installing test requirements (vpodzime)
|
||||
- Fix 'make local' (vtrefny)
|
||||
- Make the python packages own their package directories (vpodzime)
|
||||
- Don't compare translated and untranslated representations (vpodzime)
|
||||
- replace_char_with_str: Fix the character count. (dshea)
|
||||
- Ditch autopoint. (dshea)
|
||||
|
||||
* Mon Dec 12 2016 Charalampos Stratakis <cstratak@redhat.com> - 0.7-4
|
||||
- Rebuild for Python 3.6
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user