Skip to content

Commit 1d7367d

Browse files
reillyeongitster
authored andcommitted
git-p4: Avoid modules deprecated in Python 2.6.
The popen2, sha and sets modules are deprecated in Python 2.6 (sha in Python 2.5). Both popen2 and sha are not actually used in git-p4. Replace usage of sets.Set with the builtin set object. The built-in set object was added in Python 2.4 and is already used in other parts of this script, so this dependency is nothing new. Signed-off-by: Reilly Grant <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 0460dba commit 1d7367d

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

contrib/fast-import/git-p4

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,10 @@
88
# License: MIT <http://www.opensource.org/licenses/mit-license.php>
99
#
1010

11-
import optparse, sys, os, marshal, popen2, subprocess, shelve
12-
import tempfile, getopt, sha, os.path, time, platform
11+
import optparse, sys, os, marshal, subprocess, shelve
12+
import tempfile, getopt, os.path, time, platform
1313
import re
1414

15-
from sets import Set;
16-
1715
verbose = False
1816

1917

@@ -864,8 +862,8 @@ class P4Sync(Command):
864862

865863
self.usage += " //depot/path[@revRange]"
866864
self.silent = False
867-
self.createdBranches = Set()
868-
self.committedChanges = Set()
865+
self.createdBranches = set()
866+
self.committedChanges = set()
869867
self.branch = ""
870868
self.detectBranches = False
871869
self.detectLabels = False
@@ -1662,7 +1660,7 @@ class P4Sync(Command):
16621660

16631661
if len(self.changesFile) > 0:
16641662
output = open(self.changesFile).readlines()
1665-
changeSet = Set()
1663+
changeSet = set()
16661664
for line in output:
16671665
changeSet.add(int(line))
16681666

0 commit comments

Comments
 (0)