Skip to content

Commit

Permalink
properly set version in python 3.7
Browse files Browse the repository at this point in the history
  • Loading branch information
beaufour committed Oct 7, 2022
1 parent 2437b20 commit fb92195
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"Photoset",
"Photosets",
"pset",
"pyright",
"pytest",
"somedirname",
"somename",
Expand Down
10 changes: 8 additions & 2 deletions flickr_download/flick_download.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#
import argparse
import errno
import importlib.metadata
import json
import logging
import os
Expand Down Expand Up @@ -34,7 +33,14 @@
OAUTH_TOKEN_FILE = "~/.flickr_token"
API_RETRIES = 5

__version__ = importlib.metadata.version("flickr_download")
try:
import importlib.metadata

__version__ = importlib.metadata.version("flickr_download")
except ModuleNotFoundError:
import importlib_metadata # pyright: reportMissingImports=false

__version__ = importlib_metadata.version("flickr_download")


def _init(key: str, secret: str, oauth: Optional[str]) -> bool:
Expand Down

0 comments on commit fb92195

Please sign in to comment.