Skip to content

Commit 3e00880

Browse files
committed
remove double-quote preference here....
it is now done in xdis which is where it is better done
1 parent 40c4764 commit 3e00880

File tree

3 files changed

+2
-14
lines changed

3 files changed

+2
-14
lines changed

uncompyle6/scanner.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -649,16 +649,6 @@ def get_scanner(version: Union[str, tuple], is_pypy=False, show_asm=None) -> Sca
649649
return scanner
650650

651651

652-
def prefer_double_quote(string: str) -> str:
653-
"""
654-
Prefer a double quoted string over a
655-
single quoted string when possible
656-
"""
657-
if string[1:-1].find('"') == -1:
658-
return f'"{string[1:-1]}"'
659-
return string
660-
661-
662652
if __name__ == "__main__":
663653
import inspect
664654

uncompyle6/scanners/scanner3.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
from xdis.bytecode import _get_const_info
4747
from xdis.opcodes.opcode_3x import parse_fn_counts_30_35
4848

49-
from uncompyle6.scanner import CONST_COLLECTIONS, Scanner, prefer_double_quote
49+
from uncompyle6.scanner import CONST_COLLECTIONS, Scanner
5050
from uncompyle6.scanners.tok import Token
5151
from uncompyle6.util import get_code_name
5252

@@ -612,7 +612,6 @@ def ingest(
612612
pattr = "<code_object " + co_name + ">"
613613
elif isinstance(const, str):
614614
opname = "LOAD_STR"
615-
pattr = prefer_double_quote(inst.argrepr)
616615
else:
617616
if isinstance(inst.arg, int) and inst.arg < len(co.co_consts):
618617
argval, _ = _get_const_info(inst.arg, co.co_consts)

uncompyle6/scanners/scanner37base.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
from xdis import Instruction, instruction_size, iscode
4040
from xdis.bytecode import _get_const_info
4141

42-
from uncompyle6.scanner import Scanner, Token, prefer_double_quote
42+
from uncompyle6.scanner import Scanner, Token
4343

4444
globals().update(op3.opmap)
4545

@@ -386,7 +386,6 @@ def tokens_append(j, token):
386386
pattr = "<code_object " + const.co_name + ">"
387387
elif isinstance(const, str):
388388
opname = "LOAD_STR"
389-
pattr = prefer_double_quote(inst.argrepr)
390389
else:
391390
if isinstance(inst.arg, int) and inst.arg < len(co.co_consts):
392391
argval, _ = _get_const_info(inst.arg, co.co_consts)

0 commit comments

Comments
 (0)