Skip to content

Commit

Permalink
Implement abstract method in derived class
Browse files Browse the repository at this point in the history
At least with python-3.11 the code does not pass as is,

```.console
$ zkg create --features=spicy-protocol-analyzer --packagedir myprotocol
2024-05-23 07:42:37 ERROR    problem during template instantiation: Can't instantiate abstract class GithubCi with abstract method validate
Traceback (most recent call last):
  File "/usr/local/zeek/bin/zkg", line 2223, in cmd_create
    features = tmpl.features()
               ^^^^^^^^^^^^^^^
  File "/usr/local/zeek/var/lib/zkg/clones/template/package-template/__init__.py", line 402, in features
    GithubCi(),
    ^^^^^^^^^^
TypeError: Can't instantiate abstract class GithubCi with abstract method validate
error: problem during template instantiation: Can't instantiate abstract class GithubCi with abstract method validate
```
  • Loading branch information
bbannier committed May 23, 2024
1 parent 55a93dd commit 3163558
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,9 @@ def name(self):
def contentdir(self):
return os.path.join("features", self.name())

def validate(self, tmpl):
pass


class SpicyAnalyzer(zeekpkg.template.Feature):
"""Base class for Spicy-based analyzers."""
Expand Down

0 comments on commit 3163558

Please sign in to comment.