From 32ebdba6360b37641138061f1a405424d358c491 Mon Sep 17 00:00:00 2001 From: shawwwn Date: Wed, 10 Jan 2024 04:13:22 -0800 Subject: [PATCH] clean old imports --- cproxy.py | 2 ++ uproxy/__init__.py | 1 - uproxy/core.py | 6 +----- uproxy/http.py | 6 +----- uproxy/socks4.py | 6 +----- uproxy/socks5.py | 6 ++---- 6 files changed, 7 insertions(+), 20 deletions(-) diff --git a/cproxy.py b/cproxy.py index 43c3ec4..ee5f998 100755 --- a/cproxy.py +++ b/cproxy.py @@ -4,7 +4,9 @@ # Copyright (c) 2023 Shawwwn # License: MIT import sys +sys.path.pop(0) import asyncio +sys.path.insert(0, '') import time import socket import uproxy diff --git a/uproxy/__init__.py b/uproxy/__init__.py index c33984a..9f12cc0 100644 --- a/uproxy/__init__.py +++ b/uproxy/__init__.py @@ -3,7 +3,6 @@ # License: MIT from .core import * -# from .core import VERSION, LOG_NONE, LOG_INFO, LOG_DEBUG def __init__(): attrs = { diff --git a/uproxy/core.py b/uproxy/core.py index 61557c3..2fdf02c 100644 --- a/uproxy/core.py +++ b/uproxy/core.py @@ -1,11 +1,7 @@ # Core utility functions for uproxy module # Copyright (c) 2023 Shawwwn # License: MIT - -try: - import uasyncio as asyncio -except: - import asyncio +import asyncio VERSION = 2.0 LOG_NONE = 0 diff --git a/uproxy/http.py b/uproxy/http.py index b88d47a..38dab02 100644 --- a/uproxy/http.py +++ b/uproxy/http.py @@ -1,11 +1,7 @@ # HTTP/HTTPS proxy for uproxy module # Copyright (c) 2023 Shawwwn # License: MIT - -try: - import uasyncio as asyncio -except: - import asyncio +import asyncio from . import core async def send_http_response(ss, code, desc="", headers=[], body=None): diff --git a/uproxy/socks4.py b/uproxy/socks4.py index bab0085..b2599ca 100644 --- a/uproxy/socks4.py +++ b/uproxy/socks4.py @@ -1,13 +1,9 @@ # SOCKS4 proxy for uproxy module # Copyright (c) 2023 Shawwwn # License: MIT - import struct import socket -try: - import uasyncio as asyncio -except: - import asyncio +import asyncio from . import core REQ_GRANTED = 90 diff --git a/uproxy/socks5.py b/uproxy/socks5.py index 2b58efb..35bffbb 100644 --- a/uproxy/socks5.py +++ b/uproxy/socks5.py @@ -1,14 +1,12 @@ # SOCKS5 proxy for uproxy module # Copyright (c) 2023 Shawwwn # License: MIT - import struct import socket +import asyncio try: - import uasyncio as asyncio - from uasyncio.stream import Stream + from asyncio.stream import Stream except: - import asyncio class Stream: pass from . import core