Skip to content

Commit 37e685c

Browse files
authored
Format errors.py with black (#27)
1 parent e3d0c12 commit 37e685c

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

linkedin_api/clients/restli/utils/api.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
import linkedin_api.common.constants as constants
2-
from importlib.metadata import version
32
from linkedin_api.clients.restli.utils.encoder import encode
43
from typing import Dict, Any, Optional
54
from linkedin_api.common.errors import InvalidArgumentError
65
import re
76

7+
import sys
8+
9+
if sys.version_info >= (3, 8):
10+
from importlib.metadata import version
11+
else:
12+
from importlib_metadata import version
13+
14+
815
__version__ = version("linkedin-api-client")
916

1017

linkedin_api/common/errors.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ class ResponseFormattingError(Exception):
1212
"Error raised when formatting API response"
1313
pass
1414

15+
1516
class InvalidSerializedRestliError(Exception):
1617
"Error raised when an incorrectly serialized Rest.li string is encountered"
17-
pass
18+
pass

tests/clients/restli/client_test.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import json
22
from linkedin_api.clients.restli.client import RestliClient
3-
from importlib.metadata import version
43
import pytest
54
import responses
65
from responses import matchers
@@ -11,6 +10,12 @@
1110
VERSIONED_BASE_URL,
1211
HTTP_METHODS,
1312
)
13+
import sys
14+
15+
if sys.version_info >= (3, 8):
16+
from importlib.metadata import version
17+
else:
18+
from importlib_metadata import version
1419

1520
__version__ = version("linkedin-api-client")
1621
ACCESS_TOKEN = "ABC123"

0 commit comments

Comments
 (0)