Skip to content

Commit a481054

Browse files
committed
fix exceptions
1 parent 75c8116 commit a481054

File tree

3 files changed

+3
-18
lines changed

3 files changed

+3
-18
lines changed

pycryptoprosdk/libpycades.cpp

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,7 @@
1111
#define MY_ENCODING_TYPE (PKCS_7_ASN_ENCODING | X509_ASN_ENCODING)
1212
#define CERT_NAME_STR_TYPE (CERT_X500_NAME_STR | CERT_NAME_STR_CRLF_FLAG)
1313

14-
15-
class BaseError : public std::exception {
16-
public:
17-
BaseError(std::string msg) : _msg{msg} {}
18-
virtual const char* what() const noexcept { return _msg.c_str(); }
19-
private:
20-
const std::string _msg;
21-
};
22-
23-
24-
class CertDoesNotExist : public BaseError {
25-
public:
26-
CertDoesNotExist(std::string msg) : BaseError{msg} {}
27-
};
28-
29-
static PyObject* CertDoesNotExist;
14+
static PyObject* CertDoesNotExist = NULL;
3015

3116
// start helpers -------------------------------------------------------------------------------------------------------
3217

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
setup(
3838
name='pycryptoprosdk',
39-
version='1.0.0-rc3',
39+
version='1.0.0-rc4',
4040
url='https://github.com/Keyintegrity/pycryptoprosdk',
4141
author='uishnik',
4242
author_email='[email protected]',

tests/test_main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ def test_install_and_delete_certificate(self):
169169
self.sdk.delete_certificate(store, thumbprint)
170170

171171
with self.assertRaises(CertDoesNotExist) as context:
172-
cert = self.sdk.get_cert_by_thumbprint(store, thumbprint)
172+
self.sdk.get_cert_by_thumbprint(store, thumbprint)
173173
self.assertTrue('Could not find the desired certificate.' in str(context.exception))
174174

175175
def test_inn_original(self):

0 commit comments

Comments
 (0)