diff mercurial/dispatch.py @ 30576:541949a10a68

fancyopts: switch from fancyopts.getopt.* to getopt.* In the next patch, we will be creating a bytes version of getopt.getopt() and doing that will leave getopt as unused import in fancyopts. So before removing that there are instances in codebase where instead of importing getopt, we have used fancyopts.getopt. This patch will switch all those cases so that the next patch can remove the import of getopt from fancyopts without breaking things.
author Pulkit Goyal <7895pulkit@gmail.com>
date Tue, 06 Dec 2016 06:27:58 +0530
parents d83ca854fa21
children 2d555d753f0e
line wrap: on
line diff
--- a/mercurial/dispatch.py	Mon Dec 05 06:46:51 2016 +0530
+++ b/mercurial/dispatch.py	Tue Dec 06 06:27:58 2016 +0530
@@ -10,6 +10,7 @@
 import atexit
 import difflib
 import errno
+import getopt
 import os
 import pdb
 import re
@@ -448,7 +449,7 @@
 
     try:
         args = fancyopts.fancyopts(args, commands.globalopts, options)
-    except fancyopts.getopt.GetoptError as inst:
+    except getopt.GetoptError as inst:
         raise error.CommandError(None, inst)
 
     if args:
@@ -471,7 +472,7 @@
 
     try:
         args = fancyopts.fancyopts(args, c, cmdoptions, gnu=True)
-    except fancyopts.getopt.GetoptError as inst:
+    except getopt.GetoptError as inst:
         raise error.CommandError(cmd, inst)
 
     # separate global options back out
@@ -601,7 +602,7 @@
 
     try:
         args = fancyopts.fancyopts(args, commands.globalopts, options)
-    except fancyopts.getopt.GetoptError:
+    except getopt.GetoptError:
         return
 
     if not args: