Fixes a windows error mentioned in #16

This commit is contained in:
László Károlyi 2020-04-17 15:54:50 +02:00
parent 20bf35ead8
commit 8e0bb18cd0
Signed by: karolyi
GPG Key ID: 2DCAF25E55735BFE
1 changed files with 8 additions and 1 deletions

View File

@ -1,6 +1,5 @@
from http.client import HTTPResponse
from logging import getLogger
from os import geteuid
from pathlib import Path
from tempfile import gettempdir, gettempprefix
from threading import Thread
@ -9,6 +8,14 @@ from typing import Callable, Optional
from urllib.error import HTTPError
from urllib.request import Request, urlopen
try:
from os import geteuid
except ImportError:
def geteuid():
'Windows does not have `os.geteuid()`.'
return '1'
LOGGER = getLogger(__name__)
TMP_PATH = Path(gettempdir()).joinpath(
f'{gettempprefix()}-py3-validate-email-{geteuid()}')