from sys import version, hexversion RUNNING_PYPY = ("pypy" in version.lower()) RUNNING_PYTHON3 = (hexversion >= 0x03000000)
Fn1 = FileID.name s11 = os.stat(Fn1) return ','.join([ Fn1, '#', 'Path=' + os.path.abspath(Fn1), 'Size=' + str(s11[6]), 'Accessed=' + strftime("%m_%d_%y_at_%H_%M_%S", localtime(s11[7])), 'Modified=' + strftime("%m_%d_%y_at_%H_%M_%S", localtime(s11[8])), 'Created=' + strftime("%m_%d_%y_at_%H_%M_%S", localtime(s11[9])), 'FullInfo=' + str(s11) ]) LogNote1("Running Jazz18Heap with parameters:" + ' '.join(argv) + ' #Python Version' + version) LogNote1("Python Flavor/Version: " + version) if not ('pypy' in version.lower()): LogNote1( "Note that you should run Jazz18Heap with PyPy ('www.pypy.org') for full speed (otherwise speeds may be 10x sloer)" ) def LogOpeningFile1(FileID): LogNote1("Opening " + FileInfo1(FileID)) def LogClosingFile1(FileID): LogNote1("Closed " + FileInfo1(FileID)) def LogRunningFile1(FileID): LogNote1("Running " + FileInfo1(FileID))
unicode_literals) import re from sys import version as python_version from threading import RLock from builtins import * from builtins import object, str from future import standard_library from .common import (handle_exception, handle_multi_result, handle_multi_result_json) standard_library.install_aliases() is_pypy = 'pypy' in python_version.lower() version = tuple([int(x) for x in python_version.strip().split()[0].split('.')]) # needed for CFFI under Python2 if version < (3, 0, 0): from past.types.oldstr import oldstr as str if not is_pypy and version < (3, 0, 0): # for Python2 from .py2.gosnmp_python import SetPyPy, NewRPCSessionV1, NewRPCSessionV2c, NewRPCSessionV3, RPCConnect, RPCGet, \ RPCGetNext, RPCSetInteger, RPCSetIPAddress, RPCSetString, RPCClose else: # for all versions of PyPy and also Python3 from .cffi.gosnmp_python import SetPyPy, NewRPCSessionV1, NewRPCSessionV2c, NewRPCSessionV3, RPCConnect, RPCGet, \ RPCGetNext, RPCSetInteger, RPCSetIPAddress, RPCSetString, RPCClose SetPyPy()
from tests.utils import TestCaseWithUtils, temp_attrs, assert_unique, Counter, skipUnless, OldStyleClass try: from collections import OrderedDict except ImportError: from ordereddict import OrderedDict try: from collections import ChainMap except ImportError: from chainmap import ChainMap from cheap_repr import basic_repr, register_repr, cheap_repr, PY2, PY3, ReprSuppressedWarning, find_repr_function, \ raise_exceptions_from_default_repr, repr_registry PYPY = 'pypy' in version.lower() class FakeExpensiveReprClass(object): def __repr__(self): return 'bad' register_repr(FakeExpensiveReprClass)(basic_repr) class ErrorClass(object): def __init__(self, error=False): self.error = error def __repr__(self):
from sys import version_info, version from setuptools import setup install_requires = [] if version_info[0] == 2: tests_require = ['Django<2', 'chainmap'] install_requires += ['qualname'] elif version_info[:2] == (3, 5): tests_require = ['Django<3'] else: tests_require = ['Django'] if 'pypy' not in version.lower(): if version_info[0] == 2: tests_require += ['pandas>=0.24.2,<0.25'] tests_require += ['numpy>=1.16.3,<1.17'] elif version_info[:2] == (3, 5): tests_require += ['pandas>=0.24.2,<0.26'] tests_require += ['numpy>=1.16.3,<1.19'] else: tests_require += ['pandas>=0.24.2'] tests_require += ['numpy>=1.16.3'] tests_require += ['pytest'] print(version_info, tests_require) setup( name='cheap_repr',