Skip to content
Snippets Groups Projects
Commit 1572f790 authored by Ian Moody's avatar Ian Moody
Browse files

convert: remove old ElementTree import cruft from darcs

All the `import elementtree` attempts seem to pre-date py2.5, when it was
brought into the standard library, and the manual `cElementTree` fast
implementation import has been unnecessary and deprecated since py3.3.
parent cf566b57
No related branches found
No related tags found
2 merge requests!177branching,!172convert: get test-convert-darcs.t passing under py3
...@@ -47,6 +47,7 @@ ...@@ -47,6 +47,7 @@
'mercurial.thirdparty.zope', 'mercurial.thirdparty.zope',
'mercurial.thirdparty.zope.interface', 'mercurial.thirdparty.zope.interface',
'typing', 'typing',
'xml.etree.ElementTree',
) )
# Allow list of symbols that can be directly imported. # Allow list of symbols that can be directly imported.
......
...@@ -8,6 +8,10 @@ ...@@ -8,6 +8,10 @@
import os import os
import re import re
import shutil import shutil
from xml.etree.ElementTree import (
ElementTree,
XMLParser,
)
from mercurial.i18n import _ from mercurial.i18n import _
from mercurial import ( from mercurial import (
...@@ -20,26 +24,6 @@ ...@@ -20,26 +24,6 @@
NoRepo = common.NoRepo NoRepo = common.NoRepo
# The naming drift of ElementTree is fun!
try:
import xml.etree.cElementTree.ElementTree as ElementTree
import xml.etree.cElementTree.XMLParser as XMLParser
except ImportError:
try:
import xml.etree.ElementTree.ElementTree as ElementTree
import xml.etree.ElementTree.XMLParser as XMLParser
except ImportError:
try:
import elementtree.cElementTree.ElementTree as ElementTree
import elementtree.cElementTree.XMLParser as XMLParser
except ImportError:
try:
import elementtree.ElementTree.ElementTree as ElementTree
import elementtree.ElementTree.XMLParser as XMLParser
except ImportError:
pass
class darcs_source(common.converter_source, common.commandline): class darcs_source(common.converter_source, common.commandline):
def __init__(self, ui, repotype, path, revs=None): def __init__(self, ui, repotype, path, revs=None):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment