Skip to content

Commit

Permalink
Merge pull request #18 from python-poetry/fix/check-export-command-ex…
Browse files Browse the repository at this point in the history
…istence

Check the existence of the export command before attempting to delete it
  • Loading branch information
sdispater authored Nov 24, 2021
2 parents d78934d + 1cc69ee commit 46bd398
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/psf/black
rev: 21.8b0
rev: 21.11b1
hooks:
- id: black

Expand All @@ -10,7 +10,7 @@ repos:
- id: flake8

- repo: https://github.com/timothycrosley/isort
rev: 5.9.3
rev: 5.10.1
hooks:
- id: isort
additional_dependencies: [toml]
Expand Down
3 changes: 2 additions & 1 deletion src/poetry_export_plugin/plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ def activate(self, application: "Application"):

# If you're checking this code out to get inspiration
# for your own plugins: DON'T DO THIS!
del application.command_loader._factories["export"]
if "export" in application.command_loader._factories:
del application.command_loader._factories["export"]

for command in COMMANDS:
application.command_loader.register_factory(command, load_command(command))

0 comments on commit 46bd398

Please # to comment.