Skip to content

Commit

Permalink
fix test for valid class name
Browse files Browse the repository at this point in the history
  • Loading branch information
mcflugen committed Jan 8, 2024
1 parent 120458e commit 3357830
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/bmipy/cmd.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
"""Command line interface that create template BMI implementations."""
from __future__ import annotations

import keyword

import click

from bmipy._template import Template
Expand All @@ -12,7 +14,7 @@
@click.pass_context
def main(ctx: click.Context, name: str):
"""Render a template BMI implementation in Python for class NAME."""
if name.isidentifier():
if name.isidentifier() and not keyword.iskeyword(name):
print(Template(name).render())
else:
click.secho(
Expand Down

0 comments on commit 3357830

Please sign in to comment.