mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-29 17:47:14 +02:00
Remove unnecessary "ensure_python3()" blocks
This commit is contained in:
@ -18,7 +18,6 @@ import click
|
||||
|
||||
from platformio.commands.home.helpers import is_port_used
|
||||
from platformio.commands.home.run import run_server
|
||||
from platformio.compat import ensure_python3
|
||||
|
||||
|
||||
@click.command("home", short_help="GUI to manage PlatformIO")
|
||||
@ -49,8 +48,6 @@ from platformio.compat import ensure_python3
|
||||
),
|
||||
)
|
||||
def cli(port, host, no_open, shutdown_timeout, session_id):
|
||||
ensure_python3()
|
||||
|
||||
# Ensure PIO Home mimetypes are known
|
||||
mimetypes.add_type("text/html", ".html")
|
||||
mimetypes.add_type("text/css", ".css")
|
||||
|
@ -20,7 +20,6 @@ import click
|
||||
|
||||
from platformio import fs
|
||||
from platformio.clients.registry import RegistryClient
|
||||
from platformio.compat import ensure_python3
|
||||
from platformio.package.meta import PackageSpec, PackageType
|
||||
from platformio.package.pack import PackagePacker
|
||||
from platformio.package.unpack import FileUnpacker, TARArchiver
|
||||
@ -81,8 +80,6 @@ def package_pack(package, output):
|
||||
help="Notify by email when package is processed",
|
||||
)
|
||||
def package_publish(package, owner, released_at, private, notify):
|
||||
assert ensure_python3()
|
||||
|
||||
# publish .tar.gz instantly without repacking
|
||||
if not os.path.isdir(package) and isinstance(
|
||||
FileUnpacker.new_archiver(package), TARArchiver
|
||||
|
@ -28,7 +28,6 @@ from platformio.commands.device import helpers as device_helpers
|
||||
from platformio.commands.device.command import device_monitor as cmd_device_monitor
|
||||
from platformio.commands.run.command import cli as cmd_run
|
||||
from platformio.commands.test.command import cli as cmd_test
|
||||
from platformio.compat import ensure_python3
|
||||
from platformio.package.manager.core import inject_contrib_pysite
|
||||
from platformio.project.exception import NotPlatformIOProjectError
|
||||
|
||||
@ -37,7 +36,6 @@ from platformio.project.exception import NotPlatformIOProjectError
|
||||
@click.option("-a", "--agent", multiple=True)
|
||||
@click.pass_context
|
||||
def cli(ctx, agent):
|
||||
assert ensure_python3()
|
||||
ctx.obj = agent
|
||||
inject_contrib_pysite(verify_openssl=True)
|
||||
|
||||
|
@ -20,7 +20,7 @@ import tarfile
|
||||
import tempfile
|
||||
|
||||
from platformio import fs
|
||||
from platformio.compat import IS_WINDOWS, ensure_python3
|
||||
from platformio.compat import IS_WINDOWS
|
||||
from platformio.package.exception import PackageException, UserSideException
|
||||
from platformio.package.manifest.parser import ManifestFileType, ManifestParserFactory
|
||||
from platformio.package.manifest.schema import ManifestSchema
|
||||
@ -94,7 +94,6 @@ class PackagePacker(object):
|
||||
]
|
||||
|
||||
def __init__(self, package, manifest_uri=None):
|
||||
assert ensure_python3()
|
||||
self.package = package
|
||||
self.manifest_uri = manifest_uri
|
||||
|
||||
|
@ -24,8 +24,9 @@ from functools import wraps
|
||||
from glob import glob
|
||||
|
||||
import click
|
||||
import zeroconf
|
||||
|
||||
from platformio import __version__, compat, exception, proc
|
||||
from platformio import __version__, exception, proc
|
||||
from platformio.compat import IS_MACOS, IS_WINDOWS
|
||||
from platformio.fs import cd, load_json # pylint: disable=unused-import
|
||||
from platformio.proc import exec_command # pylint: disable=unused-import
|
||||
@ -156,11 +157,6 @@ def get_logical_devices():
|
||||
|
||||
|
||||
def get_mdns_services():
|
||||
compat.ensure_python3()
|
||||
|
||||
# pylint: disable=import-outside-toplevel
|
||||
import zeroconf
|
||||
|
||||
class mDNSListener(object):
|
||||
def __init__(self):
|
||||
self._zc = zeroconf.Zeroconf(interfaces=zeroconf.InterfaceChoice.All)
|
||||
|
Reference in New Issue
Block a user