Ansgar pushed to branch deploy at Debian FTP Team / dak
Commits:
-
25ed1f80
by Ansgar at 2020-10-31T09:07:24+01:00
-
578f0fb0
by Ansgar at 2020-10-31T09:09:29+01:00
-
d49859b2
by Ansgar at 2020-10-31T09:10:53+01:00
2 changed files:
Changes:
... | ... | @@ -14,6 +14,8 @@ |
14 | 14 |
|
15 | 15 |
################################################################################
|
16 | 16 |
|
17 |
+import warnings
|
|
18 |
+ |
|
17 | 19 |
from sqlalchemy import Column, Integer, Text
|
18 | 20 |
from sqlalchemy.schema import Index
|
19 | 21 |
|
... | ... | @@ -45,12 +47,16 @@ class Architecture(BaseTimestamp): |
45 | 47 |
|
46 | 48 |
def __eq__(self, val):
|
47 | 49 |
if isinstance(val, str):
|
50 |
+ warnings.warn("comparison with a `str` is deprecated", DeprecationWarning)
|
|
48 | 51 |
return (self.arch_string == val)
|
49 | 52 |
# This signals to use the normal comparison operator
|
50 | 53 |
return NotImplemented
|
51 | 54 |
|
52 | 55 |
def __ne__(self, val):
|
53 | 56 |
if isinstance(val, str):
|
57 |
+ warnings.warn("comparison with a `str` is deprecated", DeprecationWarning)
|
|
54 | 58 |
return (self.arch_string != val)
|
55 | 59 |
# This signals to use the normal comparison operator
|
56 | 60 |
return NotImplemented
|
61 |
+ |
|
62 |
+ __hash__ = BaseTimestamp.__hash__
|
... | ... | @@ -14,6 +14,8 @@ |
14 | 14 |
|
15 | 15 |
################################################################################
|
16 | 16 |
|
17 |
+import warnings
|
|
18 |
+ |
|
17 | 19 |
from sqlalchemy import Column, Integer, Text
|
18 | 20 |
from sqlalchemy.schema import Index
|
19 | 21 |
|
... | ... | @@ -43,12 +45,16 @@ class Section(BaseTimestamp): |
43 | 45 |
|
44 | 46 |
def __eq__(self, val):
|
45 | 47 |
if isinstance(val, str):
|
48 |
+ warnings.warn("comparison with a `str` is deprecated", DeprecationWarning)
|
|
46 | 49 |
return (self.section == val)
|
47 | 50 |
# This signals to use the normal comparison operator
|
48 | 51 |
return NotImplemented
|
49 | 52 |
|
50 | 53 |
def __ne__(self, val):
|
51 | 54 |
if isinstance(val, str):
|
55 |
+ warnings.warn("comparison with a `str` is deprecated", DeprecationWarning)
|
|
52 | 56 |
return (self.section != val)
|
53 | 57 |
# This signals to use the normal comparison operator
|
54 | 58 |
return NotImplemented
|
59 |
+ |
|
60 |
+ __hash__ = BaseTimestamp.__hash__
|