Skip to content

Commit 591cb73

Browse files
committed
Fixed formatting and added explicit to ctors
1 parent d3f618b commit 591cb73

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

tests/custom_exceptions.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,4 @@ def __init__(self, message):
77
super().__init__(message)
88

99
def __str__(self):
10-
s = "[PythonMyException7]: " + self.message.a
11-
return s
10+
return "[PythonMyException7]: " + self.message.a

tests/test_exceptions.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,12 @@ struct PythonAlreadySetInDestructor {
112112
};
113113

114114
struct CustomData {
115-
CustomData(const std::string &a) : a(a) {}
115+
explicit CustomData(const std::string &a) : a(a) {}
116116
std::string a;
117117
};
118118

119119
struct MyException7 {
120-
MyException7(const CustomData &message) : message(message) {}
120+
explicit MyException7(const CustomData &message) : message(message) {}
121121
CustomData message;
122122
};
123123

0 commit comments

Comments
 (0)