Description: Upstream_c72349f3153134d5cb0161add9f4ed4b75d0a7c4
 Fix string parsing with newline (#123)
 .
 When looping over a joined str, if a node is ast.Str and the value is
 just a newline "\n", the write() function adds an additional indentation
 after it, which fails to represent the original string. By calling
 self.result.append() here directly the issue is resolved.
 .
 astor (0.7.1-1) unstable; urgency=medium
 .
   * Initial release.
Author: Adam Cecile <acecile@le-vert.net>

---
Origin: upstream, https://github.com/berkerpeksag/astor/commit/c72349f3153134d5cb0161add9f4ed4b75d0a7c4
Bug: https://github.com/berkerpeksag/astor/pull/123
Forwarded: not-needed
Reviewed-By: Upstream
Last-Update: 2019-04-23

--- astor-0.7.1.orig/AUTHORS
+++ astor-0.7.1/AUTHORS
@@ -14,3 +14,4 @@ And with some modifications based on Arm
 * Lenny Truong <leonardtruong@protonmail.com>
 * Radomír Bosák <radomir.bosak@gmail.com>
 * Kodi Arfer <git@arfer.net>
+* Felix Yan <felixonmars@archlinux.org>
--- astor-0.7.1.orig/astor/code_gen.py
+++ astor-0.7.1/astor/code_gen.py
@@ -168,8 +168,6 @@ class SourceGenerator(ExplicitNodeVisito
                     visit(item)
                 elif callable(item):
                     item()
-                elif item == '\n':
-                    newline()
                 else:
                     if self.new_lines:
                         append('\n' * self.new_lines)
@@ -220,7 +218,7 @@ class SourceGenerator(ExplicitNodeVisito
 
     def else_body(self, elsewhat):
         if elsewhat:
-            self.write('\n', 'else:')
+            self.write(self.newline, 'else:')
             self.body(elsewhat)
 
     def body_or_else(self, node):
@@ -359,7 +357,7 @@ class SourceGenerator(ExplicitNodeVisito
             if len(else_) == 1 and isinstance(else_[0], ast.If):
                 node = else_[0]
                 set_precedence(node, node.test)
-                self.write('\n', 'elif ', node.test, ':')
+                self.write(self.newline, 'elif ', node.test, ':')
                 self.body(node.body)
             else:
                 self.else_body(else_)
--- astor-0.7.1.orig/astor/source_repr.py
+++ astor-0.7.1/astor/source_repr.py
@@ -71,7 +71,7 @@ def wrap_line(line, maxline=79, result=[
 
     indentation = line[0]
     lenfirst = len(indentation)
-    indent = lenfirst - len(indentation.strip())
+    indent = lenfirst - len(indentation.lstrip())
     assert indent in (0, lenfirst)
     indentation = line.pop(0) if indent else ''
 
--- astor-0.7.1.orig/tests/test_code_gen.py
+++ astor-0.7.1/tests/test_code_gen.py
@@ -516,6 +516,11 @@ class CodegenTestCase(unittest.TestCase,
         x = f"""{host}\n\t{port}\n"""
         '''
         self.assertSrcRoundtripsGtVer(source, (3, 6))
+        source = '''
+        if 1:
+            x = f'{host}\\n\\t{port}\\n'
+        '''
+        self.assertSrcRoundtripsGtVer(source, (3, 6))
 
     def test_docstring_function(self):
         source = '''
