Skip to content

Commit

Permalink
Use platform.system(), remove Python version check
Browse files Browse the repository at this point in the history
  • Loading branch information
elacuesta committed Jun 14, 2024
1 parent 24decd3 commit 53ff9ee
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
6 changes: 2 additions & 4 deletions scrapy_playwright/handler.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import sys
import asyncio
import logging
import platform
from contextlib import suppress
from dataclasses import dataclass
from ipaddress import ip_address
Expand Down Expand Up @@ -45,8 +45,7 @@
__all__ = ["ScrapyPlaywrightDownloadHandler"]


# Supporting for Windows
if sys.platform == "win32" and sys.version_info >= (3, 8):
if platform.system() == "Windows":
import threading

class Var:
Expand Down Expand Up @@ -74,7 +73,6 @@ def deferred_from_coro(o):
return deferred_from_coro_default(windows_get_result(o))

else:
windows_get_asyncio_event_loop = None
windows_get_result = None
deferred_from_coro = deferred_from_coro_default

Expand Down
6 changes: 3 additions & 3 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import sys
import platform

import pytest


Expand All @@ -9,8 +10,7 @@ def pytest_configure(config):

if (
config.getoption("reactor", "default") == "asyncio"
and sys.platform == "win32"
and sys.version_info >= (3, 8)
and platform.system() == "Windows"
):
import asyncio

Expand Down

0 comments on commit 53ff9ee

Please sign in to comment.