prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Repro: logger doesn't work correctly on exception
  DVC version: 0.35.5+d80137,
  Platform: Linux
  Method of installation: pip install from git
  
  https://github.com/iterative/dvc/blob/54072d70b542115a78a374fa702129b6959a1d02/dvc/command/repro.py#L50-L51 
  
  This lines should be:
  ```
  except DvcException, msg:
              logger.exception(msg)
  ```
  
  
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `dvc/command/repro.py`
  Content:
  ```
  1 from __future__ import unicode_literals
  2 
  3 import argparse
  4 import os
  5 import logging
  6 
  7 from dvc.command.base import CmdBase, append_doc_link
  8 from dvc.command.metrics import show_metrics
  9 from dvc.command.status import CmdDataStatus
  10 from dvc.exceptions import DvcException
  11 
  12 
  13 logger = logging.getLogger(__name__)
  14 
  15 
  16 class CmdRepro(CmdBase):
  17     def run(self):
  18         recursive = not self.args.single_item
  19         saved_dir = os.path.realpath(os.curdir)
  20         if self.args.cwd:
  21             os.chdir(self.args.cwd)
  22 
  23         # Dirty hack so the for loop below can at least enter once
  24         if self.args.all_pipelines:
  25             self.args.targets = [None]
  26         elif not self.args.targets:
  27             self.args.targets = self.default_targets
  28 
  29         ret = 0
  30         for target in self.args.targets:
  31             try:
  32                 stages = self.repo.reproduce(
  33                     target,
  34                     recursive=recursive,
  35                     force=self.args.force,
  36                     dry=self.args.dry,
  37                     interactive=self.args.interactive,
  38                     pipeline=self.args.pipeline,
  39                     all_pipelines=self.args.all_pipelines,
  40                     ignore_build_cache=self.args.ignore_build_cache,
  41                     no_commit=self.args.no_commit,
  42                 )
  43 
  44                 if len(stages) == 0:
  45                     logger.info(CmdDataStatus.UP_TO_DATE_MSG)
  46 
  47                 if self.args.metrics:
  48                     metrics = self.repo.metrics.show()
  49                     show_metrics(metrics)
  50             except DvcException:
  51                 logger.exception()
  52                 ret = 1
  53                 break
  54 
  55         os.chdir(saved_dir)
  56         return ret
  57 
  58 
  59 def add_parser(subparsers, parent_parser):
  60     REPRO_HELP = "Check for changes and reproduce DVC file and dependencies."
  61     repro_parser = subparsers.add_parser(
  62         "repro",
  63         parents=[parent_parser],
  64         description=append_doc_link(REPRO_HELP, "repro"),
  65         help=REPRO_HELP,
  66         formatter_class=argparse.RawDescriptionHelpFormatter,
  67     )
  68     repro_parser.add_argument(
  69         "targets",
  70         nargs="*",
  71         help="DVC file to reproduce (default - 'Dvcfile').",
  72     )
  73     repro_parser.add_argument(
  74         "-f",
  75         "--force",
  76         action="store_true",
  77         default=False,
  78         help="Reproduce even if dependencies were not changed.",
  79     )
  80     repro_parser.add_argument(
  81         "-s",
  82         "--single-item",
  83         action="store_true",
  84         default=False,
  85         help="Reproduce only single data item without recursive dependencies "
  86         "check.",
  87     )
  88     repro_parser.add_argument(
  89         "-c",
  90         "--cwd",
  91         default=os.path.curdir,
  92         help="Directory within your repo to reproduce from.",
  93     )
  94     repro_parser.add_argument(
  95         "-m",
  96         "--metrics",
  97         action="store_true",
  98         default=False,
  99         help="Show metrics after reproduction.",
  100     )
  101     repro_parser.add_argument(
  102         "--dry",
  103         action="store_true",
  104         default=False,
  105         help="Only print the commands that would be executed without "
  106         "actually executing.",
  107     )
  108     repro_parser.add_argument(
  109         "-i",
  110         "--interactive",
  111         action="store_true",
  112         default=False,
  113         help="Ask for confirmation before reproducing each stage.",
  114     )
  115     repro_parser.add_argument(
  116         "-p",
  117         "--pipeline",
  118         action="store_true",
  119         default=False,
  120         help="Reproduce the whole pipeline that the specified stage file "
  121         "belongs to.",
  122     )
  123     repro_parser.add_argument(
  124         "-P",
  125         "--all-pipelines",
  126         action="store_true",
  127         default=False,
  128         help="Reproduce all pipelines in the repo.",
  129     )
  130     repro_parser.add_argument(
  131         "--ignore-build-cache",
  132         action="store_true",
  133         default=False,
  134         help="Reproduce all descendants of a changed stage even if their "
  135         "direct dependencies didn't change.",
  136     )
  137     repro_parser.add_argument(
  138         "--no-commit",
  139         action="store_true",
  140         default=False,
  141         help="Don't put files/directories into cache.",
  142     )
  143     repro_parser.set_defaults(func=CmdRepro)
  144
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/dvc/command/repro.py b/dvc/command/repro.py
  --- a/dvc/command/repro.py
  +++ b/dvc/command/repro.py
  @@ -48,7 +48,7 @@
                       metrics = self.repo.metrics.show()
                       show_metrics(metrics)
               except DvcException:
  -                logger.exception()
  +                logger.exception("")
                   ret = 1
                   break
  
verification_info: {"golden_diff": "diff --git a/dvc/command/repro.py b/dvc/command/repro.py\n--- a/dvc/command/repro.py\n+++ b/dvc/command/repro.py\n@@ -48,7 +48,7 @@\n                     metrics = self.repo.metrics.show()\n                     show_metrics(metrics)\n             except DvcException:\n-                logger.exception()\n+                logger.exception(\"\")\n                 ret = 1\n                 break\n", "issue": "Repro: logger doesn't work correctly on exception\nDVC version: 0.35.5+d80137,\r\nPlatform: Linux\r\nMethod of installation: pip install from git\r\n\r\nhttps://github.com/iterative/dvc/blob/54072d70b542115a78a374fa702129b6959a1d02/dvc/command/repro.py#L50-L51 \r\n\r\nThis lines should be:\r\n```\r\nexcept DvcException, msg:\r\n            logger.exception(msg)\r\n```\r\n\r\n\n", "before_files": [{"content": "from __future__ import unicode_literals\n\nimport argparse\nimport os\nimport logging\n\nfrom dvc.command.base import CmdBase, append_doc_link\nfrom dvc.command.metrics import show_metrics\nfrom dvc.command.status import CmdDataStatus\nfrom dvc.exceptions import DvcException\n\n\nlogger = logging.getLogger(__name__)\n\n\nclass CmdRepro(CmdBase):\n    def run(self):\n        recursive = not self.args.single_item\n        saved_dir = os.path.realpath(os.curdir)\n        if self.args.cwd:\n            os.chdir(self.args.cwd)\n\n        # Dirty hack so the for loop below can at least enter once\n        if self.args.all_pipelines:\n            self.args.targets = [None]\n        elif not self.args.targets:\n            self.args.targets = self.default_targets\n\n        ret = 0\n        for target in self.args.targets:\n            try:\n                stages = self.repo.reproduce(\n                    target,\n                    recursive=recursive,\n                    force=self.args.force,\n                    dry=self.args.dry,\n                    interactive=self.args.interactive,\n                    pipeline=self.args.pipeline,\n                    all_pipelines=self.args.all_pipelines,\n                    ignore_build_cache=self.args.ignore_build_cache,\n                    no_commit=self.args.no_commit,\n                )\n\n                if len(stages) == 0:\n                    logger.info(CmdDataStatus.UP_TO_DATE_MSG)\n\n                if self.args.metrics:\n                    metrics = self.repo.metrics.show()\n                    show_metrics(metrics)\n            except DvcException:\n                logger.exception()\n                ret = 1\n                break\n\n        os.chdir(saved_dir)\n        return ret\n\n\ndef add_parser(subparsers, parent_parser):\n    REPRO_HELP = \"Check for changes and reproduce DVC file and dependencies.\"\n    repro_parser = subparsers.add_parser(\n        \"repro\",\n        parents=[parent_parser],\n        description=append_doc_link(REPRO_HELP, \"repro\"),\n        help=REPRO_HELP,\n        formatter_class=argparse.RawDescriptionHelpFormatter,\n    )\n    repro_parser.add_argument(\n        \"targets\",\n        nargs=\"*\",\n        help=\"DVC file to reproduce (default - 'Dvcfile').\",\n    )\n    repro_parser.add_argument(\n        \"-f\",\n        \"--force\",\n        action=\"store_true\",\n        default=False,\n        help=\"Reproduce even if dependencies were not changed.\",\n    )\n    repro_parser.add_argument(\n        \"-s\",\n        \"--single-item\",\n        action=\"store_true\",\n        default=False,\n        help=\"Reproduce only single data item without recursive dependencies \"\n        \"check.\",\n    )\n    repro_parser.add_argument(\n        \"-c\",\n        \"--cwd\",\n        default=os.path.curdir,\n        help=\"Directory within your repo to reproduce from.\",\n    )\n    repro_parser.add_argument(\n        \"-m\",\n        \"--metrics\",\n        action=\"store_true\",\n        default=False,\n        help=\"Show metrics after reproduction.\",\n    )\n    repro_parser.add_argument(\n        \"--dry\",\n        action=\"store_true\",\n        default=False,\n        help=\"Only print the commands that would be executed without \"\n        \"actually executing.\",\n    )\n    repro_parser.add_argument(\n        \"-i\",\n        \"--interactive\",\n        action=\"store_true\",\n        default=False,\n        help=\"Ask for confirmation before reproducing each stage.\",\n    )\n    repro_parser.add_argument(\n        \"-p\",\n        \"--pipeline\",\n        action=\"store_true\",\n        default=False,\n        help=\"Reproduce the whole pipeline that the specified stage file \"\n        \"belongs to.\",\n    )\n    repro_parser.add_argument(\n        \"-P\",\n        \"--all-pipelines\",\n        action=\"store_true\",\n        default=False,\n        help=\"Reproduce all pipelines in the repo.\",\n    )\n    repro_parser.add_argument(\n        \"--ignore-build-cache\",\n        action=\"store_true\",\n        default=False,\n        help=\"Reproduce all descendants of a changed stage even if their \"\n        \"direct dependencies didn't change.\",\n    )\n    repro_parser.add_argument(\n        \"--no-commit\",\n        action=\"store_true\",\n        default=False,\n        help=\"Don't put files/directories into cache.\",\n    )\n    repro_parser.set_defaults(func=CmdRepro)\n", "path": "dvc/command/repro.py"}], "after_files": [{"content": "from __future__ import unicode_literals\n\nimport argparse\nimport os\nimport logging\n\nfrom dvc.command.base import CmdBase, append_doc_link\nfrom dvc.command.metrics import show_metrics\nfrom dvc.command.status import CmdDataStatus\nfrom dvc.exceptions import DvcException\n\n\nlogger = logging.getLogger(__name__)\n\n\nclass CmdRepro(CmdBase):\n    def run(self):\n        recursive = not self.args.single_item\n        saved_dir = os.path.realpath(os.curdir)\n        if self.args.cwd:\n            os.chdir(self.args.cwd)\n\n        # Dirty hack so the for loop below can at least enter once\n        if self.args.all_pipelines:\n            self.args.targets = [None]\n        elif not self.args.targets:\n            self.args.targets = self.default_targets\n\n        ret = 0\n        for target in self.args.targets:\n            try:\n                stages = self.repo.reproduce(\n                    target,\n                    recursive=recursive,\n                    force=self.args.force,\n                    dry=self.args.dry,\n                    interactive=self.args.interactive,\n                    pipeline=self.args.pipeline,\n                    all_pipelines=self.args.all_pipelines,\n                    ignore_build_cache=self.args.ignore_build_cache,\n                    no_commit=self.args.no_commit,\n                )\n\n                if len(stages) == 0:\n                    logger.info(CmdDataStatus.UP_TO_DATE_MSG)\n\n                if self.args.metrics:\n                    metrics = self.repo.metrics.show()\n                    show_metrics(metrics)\n            except DvcException:\n                logger.exception(\"\")\n                ret = 1\n                break\n\n        os.chdir(saved_dir)\n        return ret\n\n\ndef add_parser(subparsers, parent_parser):\n    REPRO_HELP = \"Check for changes and reproduce DVC file and dependencies.\"\n    repro_parser = subparsers.add_parser(\n        \"repro\",\n        parents=[parent_parser],\n        description=append_doc_link(REPRO_HELP, \"repro\"),\n        help=REPRO_HELP,\n        formatter_class=argparse.RawDescriptionHelpFormatter,\n    )\n    repro_parser.add_argument(\n        \"targets\",\n        nargs=\"*\",\n        help=\"DVC file to reproduce (default - 'Dvcfile').\",\n    )\n    repro_parser.add_argument(\n        \"-f\",\n        \"--force\",\n        action=\"store_true\",\n        default=False,\n        help=\"Reproduce even if dependencies were not changed.\",\n    )\n    repro_parser.add_argument(\n        \"-s\",\n        \"--single-item\",\n        action=\"store_true\",\n        default=False,\n        help=\"Reproduce only single data item without recursive dependencies \"\n        \"check.\",\n    )\n    repro_parser.add_argument(\n        \"-c\",\n        \"--cwd\",\n        default=os.path.curdir,\n        help=\"Directory within your repo to reproduce from.\",\n    )\n    repro_parser.add_argument(\n        \"-m\",\n        \"--metrics\",\n        action=\"store_true\",\n        default=False,\n        help=\"Show metrics after reproduction.\",\n    )\n    repro_parser.add_argument(\n        \"--dry\",\n        action=\"store_true\",\n        default=False,\n        help=\"Only print the commands that would be executed without \"\n        \"actually executing.\",\n    )\n    repro_parser.add_argument(\n        \"-i\",\n        \"--interactive\",\n        action=\"store_true\",\n        default=False,\n        help=\"Ask for confirmation before reproducing each stage.\",\n    )\n    repro_parser.add_argument(\n        \"-p\",\n        \"--pipeline\",\n        action=\"store_true\",\n        default=False,\n        help=\"Reproduce the whole pipeline that the specified stage file \"\n        \"belongs to.\",\n    )\n    repro_parser.add_argument(\n        \"-P\",\n        \"--all-pipelines\",\n        action=\"store_true\",\n        default=False,\n        help=\"Reproduce all pipelines in the repo.\",\n    )\n    repro_parser.add_argument(\n        \"--ignore-build-cache\",\n        action=\"store_true\",\n        default=False,\n        help=\"Reproduce all descendants of a changed stage even if their \"\n        \"direct dependencies didn't change.\",\n    )\n    repro_parser.add_argument(\n        \"--no-commit\",\n        action=\"store_true\",\n        default=False,\n        help=\"Don't put files/directories into cache.\",\n    )\n    repro_parser.set_defaults(func=CmdRepro)\n", "path": "dvc/command/repro.py"}]}