Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Mar 13, 2023
1 parent 3be161e commit 21fed9c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 11 deletions.
7 changes: 3 additions & 4 deletions src/virtualenv/create/via_global_ref/_virtualenv.py
@@ -1,5 +1,4 @@
"""Patches that are applied at runtime to the virtual environment"""
# -*- coding: utf-8 -*-

import os
import sys
Expand Down Expand Up @@ -103,7 +102,7 @@ def load_module(old, name):
from imp import find_module
from pkgutil import ImpImporter, ImpLoader

class _VirtualenvImporter(object, ImpImporter):
class _VirtualenvImporter(ImpImporter):
def __init__(self, path=None):
object.__init__(self)
ImpImporter.__init__(self, path)
Expand All @@ -116,13 +115,13 @@ def find_module(self, fullname, path=None):
pass
return None

class _VirtualenvLoader(object, ImpLoader):
class _VirtualenvLoader(ImpLoader):
def __init__(self, fullname, file, filename, etc):
object.__init__(self)
ImpLoader.__init__(self, fullname, file, filename, etc)

def load_module(self, fullname):
module = super(_VirtualenvLoader, self).load_module(fullname)
module = super().load_module(fullname)
patch_dist(module)
module.__loader__ = None # distlib fallback
return module
Expand Down
3 changes: 1 addition & 2 deletions src/virtualenv/create/via_global_ref/builtin/python2/site.py
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
A simple shim module to fix up things on Python 2 only.
Expand Down Expand Up @@ -141,7 +140,7 @@ def disable_user_site_package():
# sys.flags is a c-extension type, so we cannot monkeypatch it, replace it with a python class to flip it
sys.original_flags = sys.flags

class Flags(object):
class Flags:
def __init__(self):
self.__dict__ = {key: getattr(sys.flags, key) for key in dir(sys.flags) if not key.startswith("_")}

Expand Down
3 changes: 1 addition & 2 deletions src/virtualenv/discovery/py_info.py
Expand Up @@ -3,7 +3,6 @@
Note: this file is also used to query target interpreters, so can only use standard library methods
"""
from __future__ import absolute_import, print_function

import json
import logging
Expand All @@ -27,7 +26,7 @@ def _get_path_extensions():
_CONF_VAR_RE = re.compile(r"\{\w+\}")


class PythonInfo(object):
class PythonInfo:
"""Contains information for a Python interpreter"""

def __init__(self):
Expand Down
6 changes: 3 additions & 3 deletions tasks/__main__zipapp.py
Expand Up @@ -7,7 +7,7 @@
NEW_IMPORT_SYSTEM = sys.version_info[0] == 3


class VersionPlatformSelect(object):
class VersionPlatformSelect:
def __init__(self):
self.archive = ABS_HERE
self._zip_file = zipfile.ZipFile(ABS_HERE, "r")
Expand Down Expand Up @@ -67,13 +67,13 @@ def _register_distutils_finder(self):
if "distlib" not in self.modules:
return

class DistlibFinder(object):
class DistlibFinder:
def __init__(self, path, loader):
self.path = path
self.loader = loader

def find(self, name):
class Resource(object):
class Resource:
def __init__(self, content):
self.bytes = content

Expand Down

0 comments on commit 21fed9c

Please sign in to comment.