Skip to content

Commit 61a92ac

Browse files
authored
small fix in __eq__ of the NoteEvent class
1 parent d6c2b6a commit 61a92ac

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

o2tools/ojn.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,12 @@ def __repr__(self):
4040
return f'{self.__class__.__name__}({attrs})'
4141

4242
def __eq__(self, other):
43-
return vars(self) == vars(other) and isinstance(other, self.__class__)
43+
return (
44+
isinstance(other, self.__class__) and
45+
hasattr(self, "__dict__") and
46+
hasattr(other, "__dict__") and
47+
self.__dict__ == other.__dict__
48+
)
4449

4550

4651
class PackageHeader:

o2tools/opa.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
22
Useful tools for OPA files.
33
4-
This has the same functionality for OPI files.
4+
This has the same functionality as OPI files.
55
66
Source:
77

0 commit comments

Comments
 (0)