Module compat
[hide private]
[frames] | no frames]

Module compat

source code

Temporary module for allowing relax to support both Python 2 and 3.

Classes [hide private]
  Bzip2Fixed
Incredibly nasty hack for bzip2 files support in Python 3.0, 3.1 and 3.2.
  GzipFixed
Incredibly nasty hack for gzipped files support in Python 3.0, 3.1 and 3.2.
  TaskQueue
Python 2.4 and earlier Queuing class replacement.
Functions [hide private]
file object
bz2_open(file, mode='r')
Abstract the numerous ways BZ2 files are handled in Python.
source code
file object
gz_open(file, mode='r')
Abstract the numerous ways gzipped files are handled in Python.
source code
 
sorted(data)
Python 2.3 and earlier replacement function for the builtin sorted() function.
source code
Variables [hide private]
  SYSTEM = 'Linux'
  PY_VERSION = 2
  __package__ = None
hash(x)

Imports: dep_check, bz2, BZ2File, gzip, deepcopy, io, os, platform, sys, threading, builtins, queue, Queue3, Queue2, StringIO, TextTestResult, pickle, Queue


Function Details [hide private]

bz2_open(file, mode='r')

source code 

Abstract the numerous ways BZ2 files are handled in Python.

Parameters:
  • file (str) - The file path to open.
  • mode - The mode to open the file with. Only the values of 'r' and 'w' for reading and writing respectively are supported.
  • model (str)
Returns: file object
The bzip2 file object.

gz_open(file, mode='r')

source code 

Abstract the numerous ways gzipped files are handled in Python.

Parameters:
  • file (str) - The file path to open.
  • mode - The mode to open the file with. Only the values of 'r' and 'w' for reading and writing respectively are supported.
  • model (str)
Returns: file object
The gzipped file object.