A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/python/cpython/commit/6a62e1d365934de82ff7c634981b3fbf218b4d5f below:

Convert test_bz2 to use tempfile (#8485) · python/cpython@6a62e1d · GitHub

File tree Expand file treeCollapse file tree 1 file changed

+6

-2

lines changed

Filter options

Expand file treeCollapse file tree 1 file changed

+6

-2

lines changed Original file line number Diff line number Diff line change

@@ -6,6 +6,7 @@

6 6

import os

7 7

import pickle

8 8

import glob

9 +

import tempfile

9 10

import pathlib

10 11

import random

11 12

import shutil

@@ -76,11 +77,14 @@ class BaseTest(unittest.TestCase):

76 77

BIG_DATA = bz2.compress(BIG_TEXT, compresslevel=1)

77 78 78 79

def setUp(self):

79 -

self.filename = support.TESTFN

80 +

fd, self.filename = tempfile.mkstemp()

81 +

os.close(fd)

80 82 81 83

def tearDown(self):

82 -

if os.path.isfile(self.filename):

84 +

try:

83 85

os.unlink(self.filename)

86 +

except FileNotFoundError:

87 +

pass

84 88 85 89 86 90

class BZ2FileTest(BaseTest):

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4