replaced StringIO imports with six.moves

This commit is contained in:
heartsucker 2019-03-24 15:04:00 +01:00
parent 664bd2dec8
commit dbfcf8ae00
No known key found for this signature in database
GPG Key ID: C49FAAAA25756E79
30 changed files with 32 additions and 34 deletions

View File

@ -5,7 +5,7 @@ import time
import shutil
from os import mkdir, unlink, listdir
from os.path import join, exists
from StringIO import StringIO
from six.moves import StringIO
from twisted.internet.protocol import ProcessProtocol
from twisted.internet.error import ProcessExitedAlready, ProcessDone

View File

@ -2,7 +2,7 @@ import sys
import time
from os import mkdir
from os.path import exists, join
from StringIO import StringIO
from six.moves import StringIO
from functools import partial
from twisted.internet.defer import Deferred, succeed

View File

@ -22,9 +22,10 @@
# wheels can be built with py3.
from __future__ import unicode_literals, print_function
import os, sys, subprocess, json, tempfile, zipfile, io, re, itertools
import os, sys, subprocess, json, tempfile, zipfile, re, itertools
import email.parser
from pprint import pprint
from six.moves import StringIO
import click
all_packages = {} # name -> version
@ -218,7 +219,7 @@ def scan(name, extra=None, path=""):
path=path+"->%s[%s]" % (dep_name, dep_extra))
def generate_dot():
f = io.StringIO()
f = StringIO()
f.write("digraph {\n")
for name, extra in extras_to_show.keys():
version = all_packages[name]

1
newsfragments/3011.other Normal file
View File

@ -0,0 +1 @@
Replace StringIO imports with six.moves.

View File

@ -1,4 +1,4 @@
from cStringIO import StringIO
from six.moves import cStringIO as StringIO
from zope.interface import implementer
from twisted.internet import defer
from twisted.internet.interfaces import IPushProducer

View File

@ -25,7 +25,7 @@ from allmydata.interfaces import IUploadable, IUploader, IUploadResults, \
from allmydata.immutable import layout
from pycryptopp.cipher.aes import AES
from cStringIO import StringIO
from six.moves import cStringIO as StringIO
from happiness_upload import share_placement, calculate_happiness

View File

@ -1,7 +1,5 @@
import os, time
from StringIO import StringIO
from six.moves import cStringIO as StringIO
from itertools import count
from zope.interface import implementer
from twisted.internet import defer

View File

@ -1,7 +1,7 @@
from __future__ import print_function
import os
from cStringIO import StringIO
from six.moves import cStringIO as StringIO
import urlparse, httplib
import allmydata # for __full_version__

View File

@ -3,7 +3,7 @@ from __future__ import print_function
import os
import urllib
from types import NoneType
from cStringIO import StringIO
from six.moves import cStringIO as StringIO
from datetime import datetime
import json

View File

@ -4,7 +4,7 @@ import os.path
import urllib
import json
from collections import defaultdict
from cStringIO import StringIO
from six.moves import cStringIO as StringIO
from twisted.python.failure import Failure
from allmydata.scripts.common import get_alias, escape_path, \
DefaultAliasMarker, TahoeError

View File

@ -1,6 +1,6 @@
from __future__ import print_function
from cStringIO import StringIO
from six.moves import cStringIO as StringIO
import urllib
from allmydata.scripts.common_http import do_http, format_http_success, format_http_error

View File

@ -1,7 +1,7 @@
from __future__ import print_function
import os, shutil, sys, urllib, time, stat, urlparse
from cStringIO import StringIO
from six.moves import cStringIO as StringIO
from twisted.internet import defer, reactor, protocol, error
from twisted.application import service, internet
from twisted.web import client as tw_client

View File

@ -1,6 +1,5 @@
import os.path
from cStringIO import StringIO
from six.moves import cStringIO as StringIO
from datetime import timedelta
import re

View File

@ -1,7 +1,7 @@
import os.path
import json
from twisted.trial import unittest
from cStringIO import StringIO
from six.moves import cStringIO as StringIO
from allmydata import uri
from allmydata.util import base32

View File

@ -1,6 +1,6 @@
import os.path
from cStringIO import StringIO
from six.moves import cStringIO as StringIO
import urllib, sys
import re
from mock import patch

View File

@ -1,4 +1,4 @@
from StringIO import StringIO
from six.moves import StringIO
import os.path
from twisted.trial import unittest
import urllib

View File

@ -1,7 +1,7 @@
import os
from os.path import dirname, join
from mock import patch, Mock
from StringIO import StringIO
from six.moves import StringIO
from sys import getfilesystemencoding
from twisted.trial import unittest
from allmydata.scripts import runner

View File

@ -4,7 +4,7 @@ import shutil
import subprocess
from os.path import join
from mock import patch
from StringIO import StringIO
from six.moves import StringIO
from functools import partial
from twisted.trial import unittest

View File

@ -2,7 +2,7 @@ import os
import mock
import json
import tempfile
from StringIO import StringIO
from six.moves import StringIO
from os.path import join
from UserDict import UserDict

View File

@ -1,5 +1,5 @@
import os
from cStringIO import StringIO
from six.moves import cStringIO as StringIO
from twisted.trial import unittest
from allmydata.mutable.publish import MutableFileHandle

View File

@ -1,4 +1,4 @@
from cStringIO import StringIO
from six.moves import cStringIO as StringIO
from twisted.internet import defer, reactor
from twisted.trial import unittest
from allmydata import uri, client

View File

@ -1,7 +1,6 @@
from __future__ import print_function
from cStringIO import StringIO
from six.moves import cStringIO as StringIO
from twisted.trial import unittest
from twisted.internet import defer

View File

@ -1,7 +1,7 @@
from __future__ import print_function
import os
from cStringIO import StringIO
from six.moves import cStringIO as StringIO
from twisted.internet import defer
from twisted.trial import unittest
from allmydata import uri

View File

@ -1,4 +1,4 @@
from cStringIO import StringIO
from six.moves import cStringIO as StringIO
from twisted.internet import defer, reactor
from foolscap.api import eventually, fireEventually
from allmydata import client

View File

@ -1,6 +1,6 @@
import os.path, time
from StringIO import StringIO
from six.moves import cStringIO as StringIO
from twisted.trial import unittest
from allmydata.util import fileutil

View File

@ -2,7 +2,7 @@ import os
from twisted.trial import unittest
from twisted.internet import defer, error
from twisted.python.usage import UsageError
from StringIO import StringIO
from six.moves import StringIO
import mock
from ..util import i2p_provider
from ..scripts import create_node, runner

View File

@ -1,7 +1,7 @@
import os
from twisted.trial import unittest
from twisted.internet import defer, error
from StringIO import StringIO
from six.moves import StringIO
import mock
from ..util import tor_provider
from ..scripts import create_node, runner

View File

@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
import os, shutil
from cStringIO import StringIO
from six.moves import cStringIO as StringIO
from twisted.trial import unittest
from twisted.python.failure import Failure
from twisted.internet import defer, task

View File

@ -5,7 +5,7 @@ def foo(): pass # keep the line number constant
import os, time, sys
import yaml
from StringIO import StringIO
from six.moves import StringIO
from datetime import timedelta
from twisted.trial import unittest
from twisted.internet import defer, reactor

View File

@ -2,7 +2,7 @@ from __future__ import print_function
import os.path, re, urllib
import json
from StringIO import StringIO
from six.moves import StringIO
from nevow import rend
from twisted.trial import unittest
from allmydata import uri, dirnode